From d9b9d1d2f210cb4aecc5dbe078d5153bba799c83 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 13 Mar 2026 06:09:42 -0700 Subject: [PATCH] fix: show dodge/parry/block/immune combat text when enemy spell misses player SMSG_SPELLLOGMISS contains miss events for both directions: spells the player cast that missed, and enemy spells that missed the player. The victim side (dodge/parry/block/immune/absorb/resist) was silently discarded. Now both caster==player and victim==player generate the appropriate combat text floater. --- src/game/game_handler.cpp | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 06140aeb..157fc8eb 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -2634,7 +2634,7 @@ void GameHandler::handlePacket(network::Packet& packet) { count = std::min(count, 32u); for (uint32_t i = 0; i < count; ++i) { if (packet.getSize() - packet.getReadPos() < (spellMissTbcLike ? 9u : 2u)) break; - /*uint64_t victimGuid =*/ readSpellMissGuid(); + uint64_t victimGuid = readSpellMissGuid(); if (packet.getSize() - packet.getReadPos() < 1) break; uint8_t missInfo = packet.readUInt8(); // REFLECT (11): extra uint32 reflectSpellId + uint8 reflectResult @@ -2647,21 +2647,24 @@ void GameHandler::handlePacket(network::Packet& packet) { break; } } - // Show combat text only for local player's spell misses + static const CombatTextEntry::Type missTypes[] = { + CombatTextEntry::MISS, // 0=MISS + CombatTextEntry::DODGE, // 1=DODGE + CombatTextEntry::PARRY, // 2=PARRY + CombatTextEntry::BLOCK, // 3=BLOCK + CombatTextEntry::MISS, // 4=EVADE + CombatTextEntry::IMMUNE, // 5=IMMUNE + CombatTextEntry::MISS, // 6=DEFLECT + CombatTextEntry::ABSORB, // 7=ABSORB + CombatTextEntry::RESIST, // 8=RESIST + }; + CombatTextEntry::Type ct = (missInfo < 9) ? missTypes[missInfo] : CombatTextEntry::MISS; if (casterGuid == playerGuid) { - static const CombatTextEntry::Type missTypes[] = { - CombatTextEntry::MISS, // 0=MISS - CombatTextEntry::DODGE, // 1=DODGE - CombatTextEntry::PARRY, // 2=PARRY - CombatTextEntry::BLOCK, // 3=BLOCK - CombatTextEntry::MISS, // 4=EVADE - CombatTextEntry::IMMUNE, // 5=IMMUNE - CombatTextEntry::MISS, // 6=DEFLECT - CombatTextEntry::ABSORB, // 7=ABSORB - CombatTextEntry::RESIST, // 8=RESIST - }; - CombatTextEntry::Type ct = (missInfo < 9) ? missTypes[missInfo] : CombatTextEntry::MISS; + // We cast a spell and it missed the target addCombatText(ct, 0, 0, true); + } else if (victimGuid == playerGuid) { + // Enemy spell missed us (we dodged/parried/blocked/resisted/etc.) + addCombatText(ct, 0, 0, false); } } break;