From 22648870f321b108db6cc5ecef33d5321e5190d5 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 17 Feb 2026 15:27:02 -0800 Subject: [PATCH] Fix phantom combat text from nearby NPC/player fights SMSG_ATTACKERSTATEUPDATE, SMSG_SPELLNONMELEEDAMAGELOG, and SMSG_SPELLDAMAGELOG were showing combat text for all combat events in the zone, not just the player's own fights. Added early-return in all three handlers when neither the attacker nor target is the player. --- src/game/game_handler.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 76e58b70..ae598424 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -6886,6 +6886,8 @@ void GameHandler::handleAttackerStateUpdate(network::Packet& packet) { bool isPlayerAttacker = (data.attackerGuid == playerGuid); bool isPlayerTarget = (data.targetGuid == playerGuid); + if (!isPlayerAttacker && !isPlayerTarget) return; // Not our combat + if (isPlayerAttacker && meleeSwingCallback_) { meleeSwingCallback_(); } @@ -6916,12 +6918,15 @@ void GameHandler::handleSpellDamageLog(network::Packet& packet) { SpellDamageLogData data; if (!SpellDamageLogParser::parse(packet, data)) return; - if (data.targetGuid == playerGuid && data.attackerGuid != 0) { + bool isPlayerSource = (data.attackerGuid == playerGuid); + bool isPlayerTarget = (data.targetGuid == playerGuid); + if (!isPlayerSource && !isPlayerTarget) return; // Not our combat + + if (isPlayerTarget && data.attackerGuid != 0) { hostileAttackers_.insert(data.attackerGuid); autoTargetAttacker(data.attackerGuid); } - bool isPlayerSource = (data.attackerGuid == playerGuid); auto type = data.isCrit ? CombatTextEntry::CRIT_DAMAGE : CombatTextEntry::SPELL_DAMAGE; addCombatText(type, static_cast(data.damage), data.spellId, isPlayerSource); } @@ -6931,6 +6936,9 @@ void GameHandler::handleSpellHealLog(network::Packet& packet) { if (!SpellHealLogParser::parse(packet, data)) return; bool isPlayerSource = (data.casterGuid == playerGuid); + bool isPlayerTarget = (data.targetGuid == playerGuid); + if (!isPlayerSource && !isPlayerTarget) return; // Not our combat + auto type = data.isCrit ? CombatTextEntry::CRIT_HEAL : CombatTextEntry::HEAL; addCombatText(type, static_cast(data.heal), data.spellId, isPlayerSource); }