From d2133aae3db6f047ca5c0ac8a23546a87a5182b8 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Mon, 11 Dec 2023 14:26:53 -0800 Subject: [PATCH] add unidentified flag to item descriptions --- src/ItemNameIndex.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ItemNameIndex.cc b/src/ItemNameIndex.cc index e2f79517..f910ed5d 100644 --- a/src/ItemNameIndex.cc +++ b/src/ItemNameIndex.cc @@ -117,13 +117,15 @@ std::string ItemNameIndex::describe_item( // For weapons, specials appear before the weapon name if ((item.data1[0] == 0x00) && (item.data1[4] != 0x00) && !item.is_s_rank_weapon()) { - // 0x80 is the unidentified flag, but we always return the identified name - // of the item here, so we ignore it + bool is_unidentified = item.data1[4] & 0x80; bool is_present = item.data1[4] & 0x40; uint8_t special_id = item.data1[4] & 0x3F; if (is_present) { ret_tokens.emplace_back("Wrapped"); } + if (is_unidentified) { + ret_tokens.emplace_back("????"); + } if (special_id) { try { ret_tokens.emplace_back(name_for_weapon_special.at(special_id));