From d09c24e756d880dcde70381b998645c0ea642b40 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 12 Nov 2026 03:03:48 +0000 Subject: [PATCH] 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). --- Source/Client/Application/ClientOptions.cpp | 4 ++-- Source/Client/Session/Session.cpp | 8 +++++--- .../Source/Contents/Events/ShowRankingScheduler.cpp.h | 8 ++++++++ 3 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 Source/Linkage/Source/Contents/Events/ShowRankingScheduler.cpp.h diff --git a/Source/Client/Application/ClientOptions.cpp b/Source/Client/Application/ClientOptions.cpp index 9da3c8210..8a315e802 100644 --- a/Source/Client/Application/ClientOptions.cpp +++ b/Source/Client/Application/ClientOptions.cpp @@ -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(entry->second); + const auto entry = this->m_options.Values().find(static_cast(id)); + return static_cast(entry == this->m_options.Values().end() ? 0 : entry->second); } // OFFSET: 0x005E7970 diff --git a/Source/Client/Session/Session.cpp b/Source/Client/Session/Session.cpp index 0b0e21a41..1b13e18fb 100644 --- a/Source/Client/Session/Session.cpp +++ b/Source/Client/Session/Session.cpp @@ -973,13 +973,15 @@ ITEM_INFO CSession::GetItem1784At(int list, int index) const { return ITEM_INFO(0); } - if (static_cast(list) < 11 && !this->inventoryCategories[list].empty()) { + if (static_cast(list) < 11 && this->inventoryCategories[list].size() != 0) { + std::list::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; } } diff --git a/Source/Linkage/Source/Contents/Events/ShowRankingScheduler.cpp.h b/Source/Linkage/Source/Contents/Events/ShowRankingScheduler.cpp.h new file mode 100644 index 000000000..71fc8e05d --- /dev/null +++ b/Source/Linkage/Source/Contents/Events/ShowRankingScheduler.cpp.h @@ -0,0 +1,8 @@ +#pragma once + +#include +#include + +using IntIntTree = std::_Tree, std::allocator>, false>>; +extern template std::_Tree_find_result, void*>*> +IntIntTree::_Find_lower_bound(const int&) const;