Core/Spells: Improve check for non damage/heal spells in Spell::TargetInfo::DoDamageAndTriggers
Port From (https://github.com/TrinityCore/TrinityCore/commit/aa38443cf388799a5debd9cbcb787f882b840530)
This commit is contained in:
@@ -8083,10 +8083,12 @@ namespace Game.Spells
|
||||
|
||||
// All calculated do it!
|
||||
// Do healing
|
||||
bool hasHealing = false;
|
||||
DamageInfo spellDamageInfo = null;
|
||||
HealInfo healInfo = null;
|
||||
if (spell.m_healing > 0)
|
||||
{
|
||||
hasHealing = true;
|
||||
int addhealth = spell.m_healing;
|
||||
if (IsCrit)
|
||||
{
|
||||
@@ -8105,8 +8107,10 @@ namespace Game.Spells
|
||||
}
|
||||
|
||||
// Do damage
|
||||
bool hasDamage = false;
|
||||
if (spell.m_damage > 0)
|
||||
{
|
||||
hasDamage = true;
|
||||
// Fill base damage struct (unitTarget - is real spell target)
|
||||
SpellNonMeleeDamage damageInfo = new(caster, spell.unitTarget, spell.m_spellInfo, spell.m_SpellVisual, spell.m_spellSchoolMask, spell.m_castId);
|
||||
// Check damage immunity
|
||||
@@ -8147,7 +8151,7 @@ namespace Game.Spells
|
||||
}
|
||||
|
||||
// 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 = new(caster, spell.unitTarget, spell.m_spellInfo, spell.m_SpellVisual, spell.m_spellSchoolMask);
|
||||
|
||||
Reference in New Issue
Block a user