Decompile 2 functions in Source/Client/ClientOptions.cpp, Source/Contents/InstantVar.h

Batch #12022 by SapitoSucio: 0 byte-identical, 2 confirmed by peer review.

- fn_03937 CSession::SetOption: logic confirmed by peer review
- fn_12610 CSession::GetOption: logic confirmed by peer review

Peer-reviewed-by: Yommy, Tanke
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-05 12:26:47 +00:00
commit 56f0054e7d
2 changed files with 15 additions and 2 deletions

View file

@ -3,12 +3,13 @@
// OFFSET: 0x0091BE20
// FUNCTION: fn_12610
int CSession::GetOption(int id) const {
return static_cast<int>(this->m_options.Get(id));
const auto entry = this->m_options.Values().find(id);
return entry == this->m_options.Values().end() ? 0 : static_cast<int>(entry->second);
}
// OFFSET: 0x005E7970
// FUNCTION: fn_03937
void CSession::SetOption(int id, int value, int extra) {
const std::uint64_t bits = static_cast<std::uint32_t>(value) | (static_cast<std::uint64_t>(extra) << 32);
this->m_options.Set(id, static_cast<std::int64_t>(bits));
this->m_options.Values()[id] = static_cast<std::int64_t>(bits);
}

View file

@ -11,11 +11,23 @@ public:
void Set(int key, std::int64_t value);
std::int64_t Get(int key) const;
void Clear();
std::map<int, std::int64_t>& Values();
const std::map<int, std::int64_t>& Values() const;
private:
/* 0004 */ std::map<int, std::int64_t> m_values;
};
// INLINED
inline std::map<int, std::int64_t>& CInstantVar::Values() {
return this->m_values;
}
// INLINED
inline const std::map<int, std::int64_t>& CInstantVar::Values() const {
return this->m_values;
}
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(CInstantVar) == 12);
#endif