From d0d58f3fb3e460895ff9f6b945f2bd3ca065fc4a Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 12 Nov 2026 01:14:19 +0000 Subject: [PATCH] Decompile fn_04233 (CMCStoreInfoBackup::ImportData) Batch #17580 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_04233 CMCStoreInfoBackup::ImportData: logic confirmed by peer review Peer-reviewed-by: Yommy, cremane, bibinir Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Store/StoreBackupData.cpp | 30 +++++++++++------------ 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/Source/Contents/Store/StoreBackupData.cpp b/Source/Contents/Store/StoreBackupData.cpp index 96eee8eb0..38a5384b1 100644 --- a/Source/Contents/Store/StoreBackupData.cpp +++ b/Source/Contents/Store/StoreBackupData.cpp @@ -27,7 +27,7 @@ static __forceinline T LoadField(const unsigned char* field) { // FUNCTION: fn_04233 void CMCStoreInfoBackup::ImportData(Json::Value& data) { this->items.clear(); - this->title = FromUtf8(data.get("Title", "").asString(), g_textCodePage); + this->title = static_cast(FromUtf8(data.get("Title", "").asString(), g_textCodePage)); Json::Value values = data["Item"]; const std::string styledText = values.toStyledString(); @@ -36,25 +36,23 @@ void CMCStoreInfoBackup::ImportData(Json::Value& data) { } for (auto entry = values.begin(); entry != values.end(); ++entry) { - Json::Value& value = *entry; - - if (!value.isObject()) { + if (!(*entry).isObject()) { continue; } ITEM_INFO item; - item.SetItemId(value.get("ID", 0).asInt()); - item.quantity = value.get("Count", 0).asInt(); - item.identified = value.get("Identified", 0).asBool(); - item.refiningLevel = value.get("RefiningLevel", 0).asInt(); - item.grade = static_cast(value.get("GradeLevel", 0).asInt()); + item.SetItemId((*entry).get("ID", 0).asInt()); + item.quantity = (*entry).get("Count", 0).asInt(); + item.identified = (*entry).get("Identified", 0).asBool(); + item.refiningLevel = (*entry).get("RefiningLevel", 0).asInt(); + item.grade = static_cast((*entry).get("GradeLevel", 0).asInt()); - StoreField(item.cards + 0, value.get("Slot_1", 0).asInt()); - StoreField(item.cards + 4, value.get("Slot_2", 0).asInt()); - StoreField(item.cards + 8, value.get("Slot_3", 0).asInt()); - StoreField(item.cards + 12, value.get("Slot_4", 0).asInt()); - item.optionCount = value.get("RandomOptionCount", 0).asInt(); - Json::Value options = value["RandomOptionList"]; + StoreField(item.cards + 0, (*entry).get("Slot_1", 0).asInt()); + StoreField(item.cards + 4, (*entry).get("Slot_2", 0).asInt()); + StoreField(item.cards + 8, (*entry).get("Slot_3", 0).asInt()); + StoreField(item.cards + 12, (*entry).get("Slot_4", 0).asInt()); + item.optionCount = (*entry).get("RandomOptionCount", 0).asInt(); + Json::Value options = (*entry)["RandomOptionList"]; int index = 0; unsigned char* record = item.options; @@ -64,7 +62,7 @@ void CMCStoreInfoBackup::ImportData(Json::Value& data) { record[4] = static_cast((*option).get("Parm1", 0).asInt()); } - item.prices[0] = static_cast(value.get("Price", 0).asInt()); + item.prices[0] = static_cast((*entry).get("Price", 0).asInt()); this->items.push_back(item); }