diff options
author | megamage <none@none> | 2009-04-30 12:02:24 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-30 12:02:24 -0500 |
commit | b3f8d33b3b6aea56cbe9c2374c0b0057bfdb147d (patch) | |
tree | 848d9972986a3281cec4d72538e5aa73f31394a5 | |
parent | 1d5700ac13bc9c8fcbed3fa0c7bd7c66cf221f53 (diff) |
*Move spellhit AI function call after damage done.
--HG--
branch : trunk
-rw-r--r-- | src/game/Spell.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 28cbd541b00..d774b62af5f 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -998,9 +998,6 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) caster->ProcDamageAndSpell(unit, procAttacker, procVictim, procEx, 0, m_attackType, m_spellInfo); } - // Needs to be called after dealing damage/healing to not remove breaking on damage auras - DoTriggersOnSpellHit(spellHitTarget); - // Call scripted function for AI if this spell is casted upon a creature (except pets) if(IS_CREATURE_GUID(target->targetGUID)) { @@ -1022,6 +1019,19 @@ void Spell::DoAllEffectOnTarget(TargetInfo *target) unit->SetStandState(UNIT_STAND_STATE_STAND); } } + + if(spellHitTarget) + { + //AI functions + if(spellHitTarget->GetTypeId() == TYPEID_UNIT && ((Creature*)spellHitTarget)->IsAIEnabled) + ((Creature*)spellHitTarget)->AI()->SpellHit(m_caster, m_spellInfo); + + if(m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->IsAIEnabled) + ((Creature*)m_caster)->AI()->SpellHitTarget(spellHitTarget, m_spellInfo); + + // Needs to be called after dealing damage/healing to not remove breaking on damage auras + DoTriggersOnSpellHit(spellHitTarget); + } } void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) @@ -1155,20 +1165,10 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) if (unit->AddAura(Aur)) m_spellAura = Aur; } - - //AI functions - if(unit->GetTypeId() == TYPEID_UNIT && ((Creature*)unit)->IsAIEnabled) - ((Creature*)unit)->AI()->SpellHit(m_caster, m_spellInfo); - - if(m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->IsAIEnabled) - ((Creature*)m_caster)->AI()->SpellHitTarget(unit, m_spellInfo); } void Spell::DoTriggersOnSpellHit(Unit *unit) { - if (!unit) - return; - // Apply additional spell effects to target if (m_preCastSpell) { |