From 3b4909a1400eec45ce73974edb9eeb3808d35e0e Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sun, 22 Mar 2026 20:30:08 -0700 Subject: [PATCH] fix: populate item subclass names for TBC expansion The TBC item query parser left subclassName empty, so TBC items showed no weapon/armor type in tooltips or the character sheet (e.g., "Sword", "Plate", "Shield" were all blank). The Classic and WotLK parsers correctly map subClass IDs to names. Fix: call getItemSubclassName() in the TBC parser, same as WotLK. Expose getItemSubclassName() in the header (was static, now shared across parser files). --- include/game/world_packets.hpp | 1 + src/game/packet_parsers_tbc.cpp | 2 +- src/game/world_packets.cpp | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/game/world_packets.hpp b/include/game/world_packets.hpp index d72aebe6..849dafbb 100644 --- a/include/game/world_packets.hpp +++ b/include/game/world_packets.hpp @@ -698,6 +698,7 @@ public: * Get human-readable string for chat type */ const char* getChatTypeString(ChatType type); +const char* getItemSubclassName(uint32_t itemClass, uint32_t subClass); // ============================================================ // Text Emotes diff --git a/src/game/packet_parsers_tbc.cpp b/src/game/packet_parsers_tbc.cpp index 9d68879f..76b77827 100644 --- a/src/game/packet_parsers_tbc.cpp +++ b/src/game/packet_parsers_tbc.cpp @@ -992,7 +992,7 @@ bool TbcPacketParsers::parseItemQueryResponse(network::Packet& packet, ItemQuery data.itemClass = itemClass; data.subClass = subClass; packet.readUInt32(); // SoundOverrideSubclass (int32, -1 = no override) - data.subclassName = ""; + data.subclassName = getItemSubclassName(itemClass, subClass); // Name strings data.name = packet.readString(); diff --git a/src/game/world_packets.cpp b/src/game/world_packets.cpp index e740ea4c..d7a294b4 100644 --- a/src/game/world_packets.cpp +++ b/src/game/world_packets.cpp @@ -2931,7 +2931,7 @@ network::Packet ItemQueryPacket::build(uint32_t entry, uint64_t guid) { return packet; } -static const char* getItemSubclassName(uint32_t itemClass, uint32_t subClass) { +const char* getItemSubclassName(uint32_t itemClass, uint32_t subClass) { if (itemClass == 2) { // Weapon switch (subClass) { case 0: return "Axe"; case 1: return "Axe";