From 02e240667116e042debeebe7fcf257362034d9f9 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 12 Nov 2026 13:19:58 +0000 Subject: [PATCH] Maintenance: B3/C3: ServiceOptions::Get (fn_06318) is static (ends plain ret, never uses ecx; callers push id / add esp,4) and the ma Batch #18330 by ragnarok-clanker: forced by an admin (49 lower score(s), 171 changed function(s)); checked with 72 compiled unit(s), including every includer of Source/Contents/Configuration/ServiceOptions.h. --- Source/Contents/Configuration/ServiceOptions.cpp | 14 +++++++------- Source/Contents/Configuration/ServiceOptions.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Source/Contents/Configuration/ServiceOptions.cpp b/Source/Contents/Configuration/ServiceOptions.cpp index 659973844..00750ae44 100644 --- a/Source/Contents/Configuration/ServiceOptions.cpp +++ b/Source/Contents/Configuration/ServiceOptions.cpp @@ -534,8 +534,8 @@ bool CGameSettingsMgr::LoadSettings() { // OFFSET: 0x006C17A0 // FUNCTION: fn_06318 -unsigned char ServiceOptions::Get(int id) const { - const auto entry = g_serviceOptions.values.find(static_cast(id)); +unsigned char ServiceOptions::Get(int id) { + const auto entry = g_serviceOptions.values.find(id); return entry == g_serviceOptions.values.end() ? 0 : entry->second; } @@ -626,7 +626,7 @@ bool GameSettings::ReadOptionTable() { } lua_pop(state, 1); - g_serviceOptions.values[static_cast(option.id)] = option.defaultValue; + g_serviceOptions.values[option.id] = option.defaultValue; } lua_pushstring(state, "Title"); @@ -709,7 +709,7 @@ __declspec(noinline) int SetOption(const char* name, unsigned char value) { return 3; } - g_serviceOptions.values[static_cast(optionId)] = value; + g_serviceOptions.values[optionId] = value; return optionId; } @@ -723,7 +723,7 @@ std::pair FindServiceOption(const char* name) { int optionId = 3; std::string strings[3]; g_session.GetTalkType(name, &optionId, strings); - const auto entry = g_serviceOptions.values.find(static_cast(optionId)); + const auto entry = g_serviceOptions.values.find(optionId); if (entry == g_serviceOptions.values.end()) { return {3, 0}; } @@ -733,11 +733,11 @@ std::pair FindServiceOption(const char* name) { // OFFSET: 0x006C2A80 // FUNCTION: fn_06325 bool ServiceOptions::Set(int id, unsigned char value) { - if (g_serviceOptions.values.find(static_cast(id)) == g_serviceOptions.values.end()) { + if (g_serviceOptions.values.find(id) == g_serviceOptions.values.end()) { return false; } - g_serviceOptions.values[static_cast(id)] = value; + g_serviceOptions.values[id] = value; return true; } diff --git a/Source/Contents/Configuration/ServiceOptions.h b/Source/Contents/Configuration/ServiceOptions.h index 882b987f5..7bbbe96e9 100644 --- a/Source/Contents/Configuration/ServiceOptions.h +++ b/Source/Contents/Configuration/ServiceOptions.h @@ -16,9 +16,9 @@ std::pair FindServiceOption(const char* name); int SetOption(const char* name, unsigned char value); struct ServiceOptions { - /* 0000 */ std::unordered_map values; + /* 0000 */ std::unordered_map values; - unsigned char Get(int id) const; + static unsigned char Get(int id); static bool Set(int id, unsigned char value); };