From e1bb2b8a40fee8379a9ca6b9edd9d196769a3ef9 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 11:55:24 +0000 Subject: [PATCH] Decompile fn_06575 (ItemCardColor) Batch #5452 by tayoba: 0 byte-identical, 1 confirmed by peer review. - fn_06575 ItemCardColor: logic confirmed by peer review Peer-reviewed-by: Yommy, bigodeira, SapitoSucio Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Items/ItemNaming.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Source/Contents/Items/ItemNaming.cpp b/Source/Contents/Items/ItemNaming.cpp index d2f9c324..2d3cbe18 100644 --- a/Source/Contents/Items/ItemNaming.cpp +++ b/Source/Contents/Items/ItemNaming.cpp @@ -838,6 +838,29 @@ struct ItemNamingContext : public ItemNaming { }; // OFFSET: 0x006D5650 +// FUNCTION: fn_06575 +std::uint32_t __fastcall ItemCardColor(const ITEM_INFO* item) { + int ids[4]; + CardIds(*item, ids); + const bool first = IsItemCard(ids[0]); + const unsigned id = static_cast(std::atoi(item->itemId.c_str())); + const bool hasCards = id - 9001u <= 498 || id - 10000u <= 999 || ids[0] == 254 || ids[0] == 255 || !Equipment(*item) + ? first + : first || IsItemCard(ids[1]) || IsItemCard(ids[2]) || IsItemCard(ids[3]); + if (!hasCards) { + return 0; + } + + const std::uint32_t colors[5] = {0, 0x00ADFF2F, 0x0000BFFF, 0x00FFA500, 0x009400D3}; + const int slots = FindItemDescription(std::atoi(item->itemId.c_str())).slots; + int count = 0; + for (int index = 0; index < 4; ++index) { + if (index >= slots && IsItemCard(ids[index])) { + ++count; + } + } + return colors[count]; +} // OFFSET: 0x006D6AA0 // FUNCTION: fn_06583