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).
This commit is contained in:
ragnarok-clanker 2026-11-05 14:49:31 +00:00
commit 7e8d6a3ac8

View file

@ -210,13 +210,18 @@ ITEM_INFO LookupClientItem(const std::list<ITEM_INFO>& values, int id, unsigned
// OFFSET: 0x00DDD5A0
// FUNCTION: fn_23387
ITEM_INFO LookupClientItemByIdentity(const std::list<ITEM_INFO>& 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