Decompile 2 functions in Source/Contents/PlayerNameDictionary.cpp, Source/Contents/PlayerNameDictionary.h

Batch #1347 by ragnarok-clanker: 0 byte-identical, 2 confirmed by peer review.

- fn_04260 DestroyPlayerNameDictionary: logic confirmed by peer review
- fn_04261 LookupPlayerName: logic confirmed by peer review

Reviewed-by: ragnarok-clanker
This commit is contained in:
ragnarok-clanker 2026-10-28 11:04:17 +00:00
commit 796a2265df
2 changed files with 31 additions and 0 deletions

View file

@ -11,6 +11,10 @@
CPlayerNameDictionary::CPlayerNameDictionary(PlayerNameContext& context) : m_enabled(true), m_context(&context) {
}
// INLINED
CPlayerNameDictionary::CPlayerNameDictionary() : m_enabled(true), m_context(nullptr) {
}
// OFFSET: 0x0060A9D0
// OFFSET: 0x0060AAE0
// FUNCTION: fn_04256
@ -90,3 +94,23 @@ void CPlayerNameDictionary::Update() {
return;
}
}
// GLOBAL: gl_24677
CPlayerNameDictionary* g_playerNameDictionary = nullptr;
// OFFSET: 0x0060AE30
// OFFSET: 0x0060AF90
// FUNCTION: fn_04260
void DestroyPlayerNameDictionary() {
if (g_playerNameDictionary) {
delete g_playerNameDictionary;
g_playerNameDictionary = nullptr;
}
}
// OFFSET: 0x0060AFB0
// FUNCTION: fn_04261
std::string LookupPlayerName(std::uint32_t id) {
return g_playerNameDictionary->Lookup(id);
}

View file

@ -19,6 +19,7 @@ struct PlayerNameContext {
class CPlayerNameDictionary {
public:
CPlayerNameDictionary();
explicit CPlayerNameDictionary(PlayerNameContext& context);
virtual ~CPlayerNameDictionary();
std::string Lookup(std::uint32_t id);
@ -53,4 +54,10 @@ private:
static_assert(sizeof(CPlayerNameDictionary) == 60);
#endif
extern CPlayerNameDictionary* g_playerNameDictionary;
bool CreatePlayerNameDictionary();
void DestroyPlayerNameDictionary();
std::string LookupPlayerName(std::uint32_t id);
#endif