diff --git a/Source/Client/ClientOptions.cpp b/Source/Client/ClientOptions.cpp index adb1ed6c..450c5120 100644 --- a/Source/Client/ClientOptions.cpp +++ b/Source/Client/ClientOptions.cpp @@ -3,12 +3,13 @@ // OFFSET: 0x0091BE20 // FUNCTION: fn_12610 int CSession::GetOption(int id) const { - return static_cast(this->m_options.Get(id)); + const auto entry = this->m_options.Values().find(id); + return entry == this->m_options.Values().end() ? 0 : static_cast(entry->second); } // OFFSET: 0x005E7970 // FUNCTION: fn_03937 void CSession::SetOption(int id, int value, int extra) { const std::uint64_t bits = static_cast(value) | (static_cast(extra) << 32); - this->m_options.Set(id, static_cast(bits)); + this->m_options.Values()[id] = static_cast(bits); } diff --git a/Source/Contents/InstantVar.h b/Source/Contents/InstantVar.h index 7dae25c8..848b7cbe 100644 --- a/Source/Contents/InstantVar.h +++ b/Source/Contents/InstantVar.h @@ -11,11 +11,23 @@ public: void Set(int key, std::int64_t value); std::int64_t Get(int key) const; void Clear(); + std::map& Values(); + const std::map& Values() const; private: /* 0004 */ std::map m_values; }; +// INLINED +inline std::map& CInstantVar::Values() { + return this->m_values; +} + +// INLINED +inline const std::map& CInstantVar::Values() const { + return this->m_values; +} + #if defined(_WIN32) && !defined(_WIN64) static_assert(sizeof(CInstantVar) == 12); #endif