Decompile 2 functions in Source/Client/Session/Session.cpp, Source/Client/Application/ClientOptions.cpp, ...

Batch #17739 by eAthena: 1 byte-identical, 1 confirmed by peer review.

- fn_23424 CSession::GetItem1784At: byte-identical
- fn_12610 CSession::GetOption: logic confirmed by peer review

Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-12 03:03:48 +00:00
commit d09c24e756
3 changed files with 15 additions and 5 deletions

View file

@ -3,8 +3,8 @@
// OFFSET: 0x0091BE20
// FUNCTION: fn_12610
int CSession::GetOption(int id) const {
const auto entry = this->m_options.Values().find(id);
return entry == this->m_options.Values().end() ? 0 : static_cast<int>(entry->second);
const auto entry = this->m_options.Values().find(static_cast<int>(id));
return static_cast<int>(entry == this->m_options.Values().end() ? 0 : entry->second);
}
// OFFSET: 0x005E7970

View file

@ -973,13 +973,15 @@ ITEM_INFO CSession::GetItem1784At(int list, int index) const {
return ITEM_INFO(0);
}
if (static_cast<unsigned int>(list) < 11 && !this->inventoryCategories[list].empty()) {
if (static_cast<unsigned int>(list) < 11 && this->inventoryCategories[list].size() != 0) {
std::list<ITEM_INFO>::const_iterator it = this->inventoryCategories[list].begin();
int position = 0;
for (const ITEM_INFO& item : this->inventoryCategories[list]) {
while (it != this->inventoryCategories[list].end()) {
if (position == index) {
return item;
return *it;
}
++position;
++it;
}
}

View file

@ -0,0 +1,8 @@
#pragma once
#include <map>
#include <xtree>
using IntIntTree = std::_Tree<std::_Tmap_traits<int, int, std::less<int>, std::allocator<std::pair<const int, int>>, false>>;
extern template std::_Tree_find_result<std::_Tree_node<std::pair<const int, int>, void*>*>
IntIntTree::_Find_lower_bound<int>(const int&) const;