From 248e128ae72acd849b577c8b86def07eefdc8035 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 29 Oct 2026 22:32:48 +0000 Subject: [PATCH] Decompile 8 functions in Source/Contents/GuildInfo.cpp, Source/Contents/GuildInfo.h Batch #3450 by Yommy: 2 byte-identical, 6 confirmed by peer review. - fn_18031 GuildInfo::ClearUnknown0114: byte-identical - fn_18032 GuildInfo::ClearMembers: logic confirmed by peer review - fn_18033 GuildInfo::RemoveUnknown0114: logic confirmed by peer review - fn_18034 GuildInfo::RemoveRelatedGuild: logic confirmed by peer review - fn_18035 GuildInfo::GetMemberAccountId: logic confirmed by peer review - fn_18036 GuildInfo::GetUnknown0114: logic confirmed by peer review - fn_18037 GuildInfo::CountRelatedGuilds: logic confirmed by peer review - fn_18038 GuildInfo::GetUnknown0114Count: byte-identical Peer-reviewed-by: superintelligence Reviewed-by: ragnarok-clanker --- Source/Contents/GuildInfo.cpp | 71 +++++++++++++++++++++++++++++++++++ Source/Contents/GuildInfo.h | 18 ++++++++- 2 files changed, 88 insertions(+), 1 deletion(-) diff --git a/Source/Contents/GuildInfo.cpp b/Source/Contents/GuildInfo.cpp index fbfc1082..c8903164 100644 --- a/Source/Contents/GuildInfo.cpp +++ b/Source/Contents/GuildInfo.cpp @@ -4,6 +4,7 @@ #include "Contents/Actors/GameActor.h" #include "Contents/Actors/Pc.h" #include "Contents/World/World.h" +#include "UI/Window/UIWindowMgr.h" // OFFSET: 0x00AE41C0 // FUNCTION: fn_18030 @@ -17,6 +18,76 @@ void GuildInfo::ChangeMemberPosition(int aid, int cid, int position) { } } +// OFFSET: 0x00AE4230 +// FUNCTION: fn_18031 +void GuildInfo::ClearUnknown0114() { + this->unknown_0114.clear(); +} + +// OFFSET: 0x00AE4240 +// FUNCTION: fn_18032 +void GuildInfo::ClearMembers() { + this->m_members.clear(); +} + +// OFFSET: 0x00AE4270 +// FUNCTION: fn_18033 +void GuildInfo::RemoveUnknown0114(int value) { + for (auto it = this->unknown_0114.begin(); it != this->unknown_0114.end(); ++it) { + if (*it == value) { + this->unknown_0114.erase(it); + return; + } + } +} + +// OFFSET: 0x00AE42C0 +// FUNCTION: fn_18034 +void GuildInfo::RemoveRelatedGuild(int unknown_0000, int unknown_0004) { + for (auto it = this->unknown_00E4.begin(); it != this->unknown_00E4.end(); ++it) { + if (it->unknown_0000 == unknown_0000 && it->unknown_0004 == unknown_0004) { + this->unknown_00E4.erase(it); + g_windowMgr.RefreshGuildWindows(); + return; + } + } +} + +// OFFSET: 0x00AE4380 +// FUNCTION: fn_18035 +int GuildInfo::GetMemberAccountId(const char* name) { + for (auto it = this->m_members.begin(); it != this->m_members.end(); ++it) { + if (it->name == name) { + return it->accountId; + } + } + return -1; +} + +// OFFSET: 0x00AE43E0 +// FUNCTION: fn_18036 +int GuildInfo::GetUnknown0114(int index) { + return this->unknown_0114[index]; +} + +// OFFSET: 0x00AE4690 +// FUNCTION: fn_18037 +int GuildInfo::CountRelatedGuilds(int unknown_0004) { + int count = 0; + for (auto it = this->unknown_00E4.begin(); it != this->unknown_00E4.end(); ++it) { + if (it->unknown_0004 == unknown_0004) { + ++count; + } + } + return count; +} + +// OFFSET: 0x00AE46C0 +// FUNCTION: fn_18038 +int GuildInfo::GetUnknown0114Count() { + return static_cast(this->unknown_0114.size()); +} + // OFFSET: 0x00AE4740 // FUNCTION: fn_18039 void GuildInfo::Init() { diff --git a/Source/Contents/GuildInfo.h b/Source/Contents/GuildInfo.h index 034e2e0e..7b6731cb 100644 --- a/Source/Contents/GuildInfo.h +++ b/Source/Contents/GuildInfo.h @@ -22,6 +22,12 @@ public: /* 0068 */ unsigned char unknown_0068[0x10]; }; + struct RelatedGuild { + /* 0000 */ int unknown_0000; + /* 0004 */ int unknown_0004; + /* 0008 */ std::string unknown_0008; + }; + /* 0000 */ std::string unknown_0000; /* 0018 */ std::string unknown_0018; /* 0030 */ std::string unknown_0030; @@ -52,7 +58,7 @@ public: /* 00D0 */ int unknown_00D0; /* 00D4 */ std::list unknown_00D4; /* 00DC */ std::list m_members; - /* 00E4 */ std::list unknown_00E4; + /* 00E4 */ std::list unknown_00E4; /* 00EC */ std::list unknown_00EC; /* 00F4 */ std::list unknown_00F4; /* 00FC */ std::map m_positions; @@ -61,6 +67,14 @@ public: /* 0114 */ std::vector unknown_0114; void ChangeMemberPosition(int aid, int cid, int position); + void ClearUnknown0114(); + void ClearMembers(); + void RemoveUnknown0114(int value); + void RemoveRelatedGuild(int unknown_0000, int unknown_0004); + int GetMemberAccountId(const char* name); + int GetUnknown0114(int index); + int CountRelatedGuilds(int unknown_0004); + int GetUnknown0114Count(); void Init(); }; @@ -71,6 +85,8 @@ static_assert(offsetof(GuildInfo::Member, characterId) == 0x04); static_assert(offsetof(GuildInfo::Member, positionId) == 0x30); static_assert(offsetof(GuildInfo::Member, positionName) == 0x34); +static_assert(sizeof(GuildInfo::RelatedGuild) == 0x20); + static_assert(sizeof(GuildInfo) == 0x120); static_assert(offsetof(GuildInfo, m_guildId) == 0xA8); static_assert(offsetof(GuildInfo, m_members) == 0xDC);