refactor: consolidate duplicate enchantment name cache in inventory tooltips

Extract getEnchantmentNames() to share a single SpellItemEnchantment.dbc
cache between both renderItemTooltip overloads, replacing two identical
19-line lazy-load blocks with single-line references.
This commit is contained in:
Kelsi 2026-03-25 18:08:08 -07:00
parent a491202f93
commit 97b44bf833
2 changed files with 13 additions and 27 deletions

View file

@ -163,6 +163,7 @@ private:
game::EquipSlot equipSlot,
int bagIndex = -1, int bagSlotIndex = -1);
void renderItemTooltip(const game::ItemDef& item, const game::Inventory* inventory = nullptr, uint64_t itemGuid = 0);
const std::unordered_map<uint32_t, std::string>& getEnchantmentNames();
// Held item helpers
void pickupFromBackpack(game::Inventory& inv, int index);