diff options
author | Gildor <gildor55@gmail.com> | 2020-04-18 18:04:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-18 18:04:45 +0200 |
commit | 247151b470e6b4950c8d63094c1b8fbf797ad246 (patch) | |
tree | 003060783db79b716e47c68a231a55cedd191f99 | |
parent | c41ae890693676c25cf58f448da9a914fcb9aaf1 (diff) |
Core/Spells: Improve check for non damage/heal spells in Spell::TargetInfo::DoDamageAndTriggers (#24467)
* this prevent cases like full absorb damage that override proper hitMask
-rw-r--r-- | src/server/game/Spells/Spell.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 11cbc12ca16..52c634cc05a 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2423,10 +2423,12 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell) // All calculated do it! // Do healing + bool hasHealing = false; std::unique_ptr<DamageInfo> spellDamageInfo; std::unique_ptr<HealInfo> healInfo; if (spell->m_healing > 0) { + hasHealing = true; uint32 addhealth = spell->m_healing; if (IsCrit) { @@ -2445,8 +2447,10 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell) } // Do damage + bool hasDamage = false; if (spell->m_damage > 0) { + hasDamage = true; // Fill base damage struct (unitTarget - is real spell target) SpellNonMeleeDamage damageInfo(caster, spell->unitTarget, spell->m_spellInfo->Id, spell->m_spellSchoolMask); // Check damage immunity @@ -2486,7 +2490,7 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell) } // Passive spell hits/misses or active spells only misses (only triggers) - if (spell->m_damage <= 0 && spell->m_healing <= 0) + if (!hasHealing && !hasDamage) { // Fill base damage struct (unitTarget - is real spell target) SpellNonMeleeDamage damageInfo(caster, spell->unitTarget, spell->m_spellInfo->Id, spell->m_spellSchoolMask); |