mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-09 18:43:51 +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
fa4f78ddcc
commit
38b1c7a4ea
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 isPlayerAttacker = (data.attackerGuid == playerGuid);
|
||||||
bool isPlayerTarget = (data.targetGuid == playerGuid);
|
bool isPlayerTarget = (data.targetGuid == playerGuid);
|
||||||
|
if (!isPlayerAttacker && !isPlayerTarget) return; // Not our combat
|
||||||
|
|
||||||
if (isPlayerAttacker && meleeSwingCallback_) {
|
if (isPlayerAttacker && meleeSwingCallback_) {
|
||||||
meleeSwingCallback_();
|
meleeSwingCallback_();
|
||||||
}
|
}
|
||||||
|
|
@ -6916,12 +6918,15 @@ void GameHandler::handleSpellDamageLog(network::Packet& packet) {
|
||||||
SpellDamageLogData data;
|
SpellDamageLogData data;
|
||||||
if (!SpellDamageLogParser::parse(packet, data)) return;
|
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);
|
hostileAttackers_.insert(data.attackerGuid);
|
||||||
autoTargetAttacker(data.attackerGuid);
|
autoTargetAttacker(data.attackerGuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isPlayerSource = (data.attackerGuid == playerGuid);
|
|
||||||
auto type = data.isCrit ? CombatTextEntry::CRIT_DAMAGE : CombatTextEntry::SPELL_DAMAGE;
|
auto type = data.isCrit ? CombatTextEntry::CRIT_DAMAGE : CombatTextEntry::SPELL_DAMAGE;
|
||||||
addCombatText(type, static_cast<int32_t>(data.damage), data.spellId, isPlayerSource);
|
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;
|
if (!SpellHealLogParser::parse(packet, data)) return;
|
||||||
|
|
||||||
bool isPlayerSource = (data.casterGuid == playerGuid);
|
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;
|
auto type = data.isCrit ? CombatTextEntry::CRIT_HEAL : CombatTextEntry::HEAL;
|
||||||
addCombatText(type, static_cast<int32_t>(data.heal), data.spellId, isPlayerSource);
|
addCombatText(type, static_cast<int32_t>(data.heal), data.spellId, isPlayerSource);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue