mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 08:03:50 +00:00
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).
This commit is contained in:
parent
7967878cd9
commit
3b4909a140
3 changed files with 3 additions and 2 deletions
|
|
@ -698,6 +698,7 @@ public:
|
||||||
* Get human-readable string for chat type
|
* Get human-readable string for chat type
|
||||||
*/
|
*/
|
||||||
const char* getChatTypeString(ChatType type);
|
const char* getChatTypeString(ChatType type);
|
||||||
|
const char* getItemSubclassName(uint32_t itemClass, uint32_t subClass);
|
||||||
|
|
||||||
// ============================================================
|
// ============================================================
|
||||||
// Text Emotes
|
// Text Emotes
|
||||||
|
|
|
||||||
|
|
@ -992,7 +992,7 @@ bool TbcPacketParsers::parseItemQueryResponse(network::Packet& packet, ItemQuery
|
||||||
data.itemClass = itemClass;
|
data.itemClass = itemClass;
|
||||||
data.subClass = subClass;
|
data.subClass = subClass;
|
||||||
packet.readUInt32(); // SoundOverrideSubclass (int32, -1 = no override)
|
packet.readUInt32(); // SoundOverrideSubclass (int32, -1 = no override)
|
||||||
data.subclassName = "";
|
data.subclassName = getItemSubclassName(itemClass, subClass);
|
||||||
|
|
||||||
// Name strings
|
// Name strings
|
||||||
data.name = packet.readString();
|
data.name = packet.readString();
|
||||||
|
|
|
||||||
|
|
@ -2931,7 +2931,7 @@ network::Packet ItemQueryPacket::build(uint32_t entry, uint64_t guid) {
|
||||||
return packet;
|
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
|
if (itemClass == 2) { // Weapon
|
||||||
switch (subClass) {
|
switch (subClass) {
|
||||||
case 0: return "Axe"; case 1: return "Axe";
|
case 0: return "Axe"; case 1: return "Axe";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue