From b0e5e5c7b35d0f444febca0aac61655480da21ff Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 11 Nov 2026 11:46:10 +0000 Subject: [PATCH] Decompile 3 functions in Source/Contents/AdventureGuide/AdventureGuideMgr.h, Source/Contents/AdventureGuide/AdventureGuideMgr.cpp, ... Batch #16787 by eAthena: 0 byte-identical, 3 confirmed by peer review. - fn_05222 CAdventureGuideMgr::CAdventureGuideMgr: logic confirmed by peer review (already on main) - fn_05227 CAdventureGuideMgr::~CAdventureGuideMgr: logic confirmed by peer review (already on main) - fn_14331 AdventureGuide::CUIIntro::OnInit: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, Yommy, br4yan Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- .../Contents/AdventureGuide/AdventureGuideMgr.cpp | 2 +- Source/Contents/AdventureGuide/AdventureGuideMgr.h | 13 ++++++++----- Source/UI/AdventureGuide/UIAdventureGuide.cpp | 9 ++++----- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/Source/Contents/AdventureGuide/AdventureGuideMgr.cpp b/Source/Contents/AdventureGuide/AdventureGuideMgr.cpp index 24f238fdb..8df1eb85d 100644 --- a/Source/Contents/AdventureGuide/AdventureGuideMgr.cpp +++ b/Source/Contents/AdventureGuide/AdventureGuideMgr.cpp @@ -1444,7 +1444,7 @@ AdventureGuideResult CAdventureGuideMgr::InsertIntroContents(int id, std::string AdventureGuideText entry; entry.first = title; entry.second = text; - introTexts.try_emplace(id, std::as_const(entry)); + introPage.texts.try_emplace(id, std::as_const(entry)); return AdventureGuideResult(true, "good"); } diff --git a/Source/Contents/AdventureGuide/AdventureGuideMgr.h b/Source/Contents/AdventureGuide/AdventureGuideMgr.h index 9ee4a1303..2a80e7331 100644 --- a/Source/Contents/AdventureGuide/AdventureGuideMgr.h +++ b/Source/Contents/AdventureGuide/AdventureGuideMgr.h @@ -31,6 +31,11 @@ struct AdventureGuideText { /* 0018 */ std::string second; }; +struct AdventureGuideIntroPage { + /* 0000 */ std::string title; + /* 0018 */ std::map texts; +}; + struct AdventureGuideEpisodeSource { /* 0000 */ const char* name; /* 0004 */ int order; @@ -85,8 +90,7 @@ public: /* 0004 */ CLuaInstance m_lua; /* 000C */ std::map m_intros; - /* 0014 */ std::string introTitle; - /* 002C */ std::map introTexts; + /* 0014 */ AdventureGuideIntroPage introPage; /* 0034 */ std::list m_episodes; /* 003C */ std::map> episodeContents; /* 0044 */ std::map> questContents; @@ -106,7 +110,7 @@ public: void GetEntryList(std::list>& out, int type, int id); AdventureGuideResult SetIntroTitle(std::string_view title) { - introTitle = title; + introPage.title = title; return AdventureGuideResult(true, "good"); } @@ -147,8 +151,7 @@ static_assert(offsetof(AdventureGuideEntry, text) == 0xC); static_assert(offsetof(AdventureGuideEntry, values) == 0x24); static_assert(offsetof(CAdventureGuideMgr, m_lua) == 0x4); static_assert(offsetof(CAdventureGuideMgr, m_intros) == 0xC); -static_assert(offsetof(CAdventureGuideMgr, introTitle) == 0x14); -static_assert(offsetof(CAdventureGuideMgr, introTexts) == 0x2C); +static_assert(offsetof(CAdventureGuideMgr, introPage) == 0x14); static_assert(offsetof(CAdventureGuideMgr, m_episodes) == 0x34); static_assert(offsetof(CAdventureGuideMgr, episodeContents) == 0x3C); static_assert(offsetof(CAdventureGuideMgr, itemEntries) == 0x54); diff --git a/Source/UI/AdventureGuide/UIAdventureGuide.cpp b/Source/UI/AdventureGuide/UIAdventureGuide.cpp index fc92d22ab..7b648b615 100644 --- a/Source/UI/AdventureGuide/UIAdventureGuide.cpp +++ b/Source/UI/AdventureGuide/UIAdventureGuide.cpp @@ -619,18 +619,17 @@ void CUIQuest::Paint() { // OFFSET: 0x009DCFF0 // FUNCTION: fn_14331 void CUIIntro::OnInit() { - const std::string& title = g_adventureGuideMgr->introTitle; - const std::map& texts = g_adventureGuideMgr->introTexts; - if (texts.empty()) { + const AdventureGuideIntroPage& intro = g_adventureGuideMgr->introPage; + if (intro.texts.empty()) { return; } - for (const auto& [id, text] : texts) { + for (const auto& [id, text] : intro.texts) { this->contents->data.emplace_back(text.first, text.second); } this->contents->UpdateScrollBar(); - this->image->SetImage(title); + this->image->SetImage(intro.title); this->contents->scrollBar->SetHidden(1); }