mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
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
(cherry picked from commit 247151b470)
This commit is contained in:
@@ -2582,10 +2582,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)
|
||||
{
|
||||
@@ -2604,8 +2606,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, spell->m_SpellVisual, spell->m_spellSchoolMask, spell->m_castId);
|
||||
// Check damage immunity
|
||||
@@ -2646,7 +2650,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, spell->m_SpellVisual, spell->m_spellSchoolMask);
|
||||
|
||||
Reference in New Issue
Block a user