[9875] Fix immunity ignoring for delayed spells

This commit is contained in:
Laise 2010-05-11 22:35:17 +03:00
parent 789f2f8167
commit 5a572b9991
3 changed files with 14 additions and 3 deletions

View file

@ -928,8 +928,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target)
unitTarget = unit; unitTarget = unit;
// Reset damage/healing counter // Reset damage/healing counter
m_damage = 0; ResetEffectDamageAndHeal();
m_healing = 0;
// Fill base trigger info // Fill base trigger info
uint32 procAttacker = m_procAttacker; uint32 procAttacker = m_procAttacker;
@ -1082,6 +1081,8 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
{ {
if (realCaster) if (realCaster)
realCaster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_IMMUNE); realCaster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_IMMUNE);
ResetEffectDamageAndHeal();
return; return;
} }
@ -1102,6 +1103,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
unit->GetCharmerOrOwnerGUID() != m_caster->GetGUID()) unit->GetCharmerOrOwnerGUID() != m_caster->GetGUID())
{ {
realCaster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE); realCaster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE);
ResetEffectDamageAndHeal();
return; return;
} }
@ -1112,6 +1114,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
!unit->isVisibleForOrDetect(m_caster, m_caster, false)) !unit->isVisibleForOrDetect(m_caster, m_caster, false))
{ {
realCaster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE); realCaster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE);
ResetEffectDamageAndHeal();
return; return;
} }
@ -1150,6 +1153,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
if (m_spellInfo->speed > 0.0f && !IsPositiveSpell(m_spellInfo->Id)) if (m_spellInfo->speed > 0.0f && !IsPositiveSpell(m_spellInfo->Id))
{ {
realCaster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE); realCaster->SendSpellMiss(unit, m_spellInfo->Id, SPELL_MISS_EVADE);
ResetEffectDamageAndHeal();
return; return;
} }
@ -6505,3 +6509,9 @@ WorldObject* Spell::GetCastingObject() const
else else
return m_caster; return m_caster;
} }
void Spell::ResetEffectDamageAndHeal()
{
m_damage = 0;
m_healing = 0;
}

View file

@ -611,6 +611,7 @@ class Spell
void DoAllEffectOnTarget(TargetInfo *target); void DoAllEffectOnTarget(TargetInfo *target);
void HandleDelayedSpellLaunch(TargetInfo *target); void HandleDelayedSpellLaunch(TargetInfo *target);
void InitializeDamageMultipliers(); void InitializeDamageMultipliers();
void ResetEffectDamageAndHeal();
void DoSpellHitOnUnit(Unit *unit, uint32 effectMask); void DoSpellHitOnUnit(Unit *unit, uint32 effectMask);
void DoAllEffectOnTarget(GOTargetInfo *target); void DoAllEffectOnTarget(GOTargetInfo *target);
void DoAllEffectOnTarget(ItemTargetInfo *target); void DoAllEffectOnTarget(ItemTargetInfo *target);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9874" #define REVISION_NR "9875"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__