From 7e8d6a3ac8ec446553de123a570893f8a110413d Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 14:49:31 +0000 Subject: [PATCH] Decompile fn_23387 (LookupClientItemByIdentity) Batch #12413 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_23387 LookupClientItemByIdentity: logic confirmed by peer review Peer-reviewed-by: KWDev, Toshiro, dori, cremane Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Items/ItemInfo.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Source/Contents/Items/ItemInfo.cpp b/Source/Contents/Items/ItemInfo.cpp index c4b9535b6..544ef8279 100644 --- a/Source/Contents/Items/ItemInfo.cpp +++ b/Source/Contents/Items/ItemInfo.cpp @@ -210,13 +210,18 @@ ITEM_INFO LookupClientItem(const std::list& values, int id, unsigned // OFFSET: 0x00DDD5A0 // FUNCTION: fn_23387 ITEM_INFO LookupClientItemByIdentity(const std::list& values, std::uint32_t id) { - for (const ITEM_INFO& value : values) { - if (value.unknown_0000[1] == id) { - return value; + if (values.empty()) { + return ITEM_INFO(0); + } + + auto it = values.begin(); + for (; it != values.end(); ++it) { + if (it->unknown_0000[1] == id) { + break; } } - return ITEM_INFO(0); + return it != values.end() ? *it : ITEM_INFO(0); } // OFFSET: 0x006D5450