From ead5ab2a671c796bad216a0524ea4329c19b02c5 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 16:39:14 +0000 Subject: [PATCH] Decompile fn_24191 (EmotionHotkeys::LoadDefaults) Batch #12521 by cremane: 0 byte-identical, 1 confirmed by peer review. - fn_24191 EmotionHotkeys::LoadDefaults: logic confirmed by peer review Peer-reviewed-by: Yommy, gordaoprogramas, KWDev, Toshiro, dori Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Hotkeys/EmotionHotkeys.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Source/Contents/Hotkeys/EmotionHotkeys.cpp b/Source/Contents/Hotkeys/EmotionHotkeys.cpp index b52079f1..f91ab632 100644 --- a/Source/Contents/Hotkeys/EmotionHotkeys.cpp +++ b/Source/Contents/Hotkeys/EmotionHotkeys.cpp @@ -71,18 +71,20 @@ void EmotionHotkeys::Save(std::uint32_t accountId, CRenderSystemBase*) const { // FUNCTION: fn_24191 bool EmotionHotkeys::LoadDefaults(std::uint32_t accountId) { this->current.clear(); - - for (int id : {544, 545, 546, 547, 549, 550, 551, 552, 553, 554}) { - this->current.emplace_back(LookupMessage(id)); - } + this->current.emplace_back(LookupMessage(544)); + this->current.emplace_back(LookupMessage(545)); + this->current.emplace_back(LookupMessage(546)); + this->current.emplace_back(LookupMessage(547)); + this->current.emplace_back(LookupMessage(549)); + this->current.emplace_back(LookupMessage(550)); + this->current.emplace_back(LookupMessage(551)); + this->current.emplace_back(LookupMessage(552)); + this->current.emplace_back(LookupMessage(553)); + this->current.emplace_back(LookupMessage(554)); CLuaInstance script; - const std::string path = "savedata\\shortcutlist\\" + ShortcutFilename(accountId) + ".lua"; - if (!script.LoadFile(path, false) || script.ReadStrings(this->current, "tbl") != 0) { - return false; - } - - return this->current.size() == 10; + const bool loaded = script.LoadFile(std::format("savedata\\shortcutlist\\{}.lua", ShortcutFilename(accountId)), false); + return loaded && script.ReadStrings(this->current, "tbl") == 0 && this->current.size() == 10; } // INLINED