diff options
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
| -rw-r--r-- | src/server/game/Spells/Spell.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 4690176be01..4975457c2d6 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -2695,12 +2695,7 @@ void Spell::TargetInfo::DoDamageAndTriggers(Spell* spell) //AI functions if (Creature* cHitTarget = _spellHitTarget->ToCreature()) if (CreatureAI* hitTargetAI = cHitTarget->AI()) - { - if (spell->m_caster->GetTypeId() == TYPEID_GAMEOBJECT) - hitTargetAI->SpellHitByGameObject(spell->m_caster->ToGameObject(), spell->m_spellInfo); - else - hitTargetAI->SpellHit(spell->m_caster->ToUnit(), spell->m_spellInfo); - } + hitTargetAI->SpellHit(spell->m_caster, spell->m_spellInfo); if (spell->m_caster->GetTypeId() == TYPEID_UNIT && spell->m_caster->ToCreature()->IsAIEnabled()) spell->m_caster->ToCreature()->AI()->SpellHitTarget(_spellHitTarget, spell->m_spellInfo); @@ -2744,19 +2739,14 @@ void Spell::GOTargetInfo::DoTargetSpellHit(Spell* spell, SpellEffectInfo const& spell->HandleEffects(nullptr, nullptr, go, spellEffectInfo, SPELL_EFFECT_HANDLE_HIT_TARGET); - //AI functions + // AI functions if (go->AI()) - { - if (spell->m_caster->GetTypeId() == TYPEID_GAMEOBJECT) - go->AI()->SpellHitByGameObject(spell->m_caster->ToGameObject(), spell->m_spellInfo); - else - go->AI()->SpellHit(spell->m_caster->ToUnit(), spell->m_spellInfo); - } + go->AI()->SpellHit(spell->m_caster, spell->m_spellInfo); if (spell->m_caster->GetTypeId() == TYPEID_UNIT && spell->m_caster->ToCreature()->IsAIEnabled()) - spell->m_caster->ToCreature()->AI()->SpellHitTargetGameObject(go, spell->m_spellInfo); + spell->m_caster->ToCreature()->AI()->SpellHitTarget(go, spell->m_spellInfo); else if (spell->m_caster->GetTypeId() == TYPEID_GAMEOBJECT && spell->m_caster->ToGameObject()->AI()) - spell->m_caster->ToGameObject()->AI()->SpellHitTargetGameObject(go, spell->m_spellInfo); + spell->m_caster->ToGameObject()->AI()->SpellHitTarget(go, spell->m_spellInfo); spell->CallScriptOnHitHandlers(); spell->CallScriptAfterHitHandlers(); |
