From 4a5cd4f91c5352f38ba8e490e3a2ab528f9fdd96 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Mon, 9 Nov 2026 13:24:41 +0000 Subject: [PATCH] Decompile fn_03892 (UIChangeMaterialWnd_List::RefreshVisibleEntries) Batch #14988 by ntrl: 0 byte-identical, 1 confirmed by peer review. - fn_03892 UIChangeMaterialWnd_List::RefreshVisibleEntries: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, Yommy, codeplay 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 9e8aead08..95bc9a03d 100644 --- a/Source/UI/UIChangeMaterialWnd.cpp +++ b/Source/UI/UIChangeMaterialWnd.cpp @@ -274,24 +274,24 @@ void UIChangeMaterialWnd_List::RefreshVisibleEntries() { this->m_entries.clear(); std::map library = g_changeMaterialMgr->m_library; - for (auto it = library.begin(); it != library.end(); ++it) { - const std::vector& recipes = it->second.m_recipes; - for (auto recipe = recipes.begin(); recipe != recipes.end(); ++recipe) { + for (const auto& item : library) { + std::vector recipes = item.second.m_recipes; + for (const ChangeMaterialRecipe& recipe : recipes) { MaterialListEntry entry = {}; - if (recipe->materials.empty() || recipe->products.empty()) { + if (recipe.materials.empty() || recipe.products.empty()) { continue; } - entry.materials.resize(recipe->materials.size()); + entry.materials.resize(recipe.materials.size()); auto material = entry.materials.begin(); - for (auto source = recipe->materials.begin(); source != recipe->materials.end(); ++source, ++material) { + for (auto source = recipe.materials.begin(); source != recipe.materials.end(); ++source, ++material) { material->id = source->itemId; material->quantity = source->count; } - entry.results.resize(recipe->products.size()); + entry.results.resize(recipe.products.size()); auto result = entry.results.begin(); - for (auto source = recipe->products.begin(); source != recipe->products.end(); ++source, ++result) { + for (auto source = recipe.products.begin(); source != recipe.products.end(); ++source, ++result) { result->id = source->itemId; result->quantity = source->count; result->amount = source->rate;