mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
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.
This commit is contained in:
parent
2cad3b9c2b
commit
22648870f3
1 changed files with 10 additions and 2 deletions
|
|
@ -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<int32_t>(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<int32_t>(data.heal), data.spellId, isPlayerSource);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue