From 6fdd9155b66c5e47b72749d39c8d110b7aa63545 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 7 Nov 2026 13:08:14 +0000 Subject: [PATCH] Decompile fn_06312 (CGameSettingsMgr::SetOption) Batch #14661 by secret: 0 byte-identical, 1 confirmed by peer review. - fn_06312 CGameSettingsMgr::SetOption: 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). --- .../Contents/Configuration/ServiceOptions.cpp | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/Source/Contents/Configuration/ServiceOptions.cpp b/Source/Contents/Configuration/ServiceOptions.cpp index 88cc92b1b..7de827579 100644 --- a/Source/Contents/Configuration/ServiceOptions.cpp +++ b/Source/Contents/Configuration/ServiceOptions.cpp @@ -72,8 +72,8 @@ public: ~CGameSettingsMgr() override; /* 000C */ std::vector options; - /* 0018 */ std::unordered_map> actions; - /* 0038 */ std::unordered_map> functions; + /* 0018 */ std::unordered_map> actions; + /* 0038 */ std::unordered_map> functions; bool LoadSettings(); bool ReadOptionTable(); @@ -439,26 +439,19 @@ CGameSettingsMgr::~CGameSettingsMgr() { // OFFSET: 0x006C0C40 // FUNCTION: fn_06312 void GameSettings::SetOption(int id, unsigned char value, bool notify) { - for (const GameSettingsOption& option : this->options) { - if (option.id != id) { - continue; - } - - if (option.type != 0) { - return; - } - - const auto entry = this->actions.find(static_cast(id)); - if (entry == this->actions.end()) { - ApplyServiceOption(id, value, notify, option.unknown_005c, option.unknown_0060); - return; - } + const std::optional option = this->FindOption(id); + if (!option || (*option)->type != 0) { + return; + } + const auto entry = this->actions.find(id); + if (entry != this->actions.end()) { const std::function action = entry->second; if (action) { - action(id, value, notify, option.unknown_005c, option.unknown_0060); + action(id, value, notify, (*option)->unknown_005c, (*option)->unknown_0060); } - return; + } else { + ApplyServiceOption(id, value, notify, (*option)->unknown_005c, (*option)->unknown_0060); } }