From 9b092782c9def505e33e935ca4af44d119873998 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 21:34:16 -0700 Subject: [PATCH] fix: normalize Classic UNIT_FIELD_AURAFLAGS harmful bit to WotLK debuff convention MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The buff/debuff bar uses 0x80 (WotLK convention) to identify debuffs. Classic UNIT_FIELD_AURAFLAGS uses 0x02 for harmful auras instead. Map Classic 0x02 → 0x80 during aura rebuild so the UI correctly separates buffs from debuffs for Classic players. --- src/game/game_handler.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 98b81291..17ae17bf 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -9011,13 +9011,16 @@ void GameHandler::handleUpdateObject(network::Packet& packet) { AuraSlot& a = playerAuras[slot]; a.spellId = it->second; // Read aura flag byte: packed 4-per-uint32 at ufAuraFlags - uint8_t aFlag = 0; + // Classic flags: 0x01=cancelable, 0x02=harmful, 0x04=helpful + // Normalize to WotLK convention: 0x80 = negative (debuff) + uint8_t classicFlag = 0; if (ufAuraFlags != 0xFFFF) { auto fit = allFields.find(static_cast(ufAuraFlags + slot / 4)); if (fit != allFields.end()) - aFlag = static_cast((fit->second >> ((slot % 4) * 8)) & 0xFF); + classicFlag = static_cast((fit->second >> ((slot % 4) * 8)) & 0xFF); } - a.flags = aFlag; + // Map Classic harmful bit (0x02) → WotLK debuff bit (0x80) + a.flags = (classicFlag & 0x02) ? 0x80u : 0u; a.durationMs = -1; a.maxDurationMs = -1; a.casterGuid = playerGuid;