From 7db87ebe0ff24a9049fab4656142a4bfc48b258b Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 6 Nov 2026 11:06:43 +0000 Subject: [PATCH] Decompile 2 functions in Source/UI/UIChangeMaterialWnd.cpp Batch #13193 by cremane: 0 byte-identical, 2 confirmed by peer review. - fn_03893 UIChangeMaterialWnd::sub_5E39A0: logic confirmed by peer review - fn_03895 UIChangeMaterialWnd::SendMsg: logic confirmed by peer review Peer-reviewed-by: gordaoprogramas, codeplay, StrawberrysherbetIX Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/UIChangeMaterialWnd.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Source/UI/UIChangeMaterialWnd.cpp b/Source/UI/UIChangeMaterialWnd.cpp index f8ad4b1b..209a38b9 100644 --- a/Source/UI/UIChangeMaterialWnd.cpp +++ b/Source/UI/UIChangeMaterialWnd.cpp @@ -329,9 +329,9 @@ void UIChangeMaterialWnd::sub_5E39A0() { *reinterpret_cast(packet + 8) = 1; unsigned char* entry = packet + 0xC; - for (const ITEM_INFO& material : this->m_materials) { - *reinterpret_cast(entry) = static_cast(material.unknown_0000[1]); - *reinterpret_cast(entry + 2) = static_cast(material.quantity); + for (auto it = this->m_materials.begin(); it != this->m_materials.end(); ++it) { + *reinterpret_cast(entry) = static_cast(it->unknown_0000[1]); + *reinterpret_cast(entry + 2) = static_cast(it->quantity); entry += 4; } @@ -395,13 +395,13 @@ int UIChangeMaterialWnd::SendMsg( this->m_resultItem.SetItemId(entry->results.front().id); this->m_resultItem.quantity = entry->results.front().quantity; - for (const MaterialReq& req : entry->materials) { + for (auto it = entry->materials.begin(); it != entry->materials.end(); ++it) { ITEM_INFO info; - info.SetItemId(req.id); - info.quantity = req.quantity; - const ITEM_INFO stock = LookupClientItem(g_session.m_inventoryItems, req.id, 1); + info.SetItemId(it->id); + info.quantity = it->quantity; + const ITEM_INFO stock = LookupClientItem(g_session.m_inventoryItems, it->id, 1); info.unknown_0000[1] = stock.unknown_0000[1]; - info.identified = req.quantity <= stock.quantity; + info.identified = it->quantity <= stock.quantity; this->m_materials.push_back(info); }