From df1376b14b81cb0c31ca61d5e1a32f32059f8eee Mon Sep 17 00:00:00 2001 From: NoFantasy Date: Mon, 2 May 2011 10:17:36 +0200 Subject: [PATCH] [11418] Add CreatureAI call JustSummoned version for GameObject* Signed-off-by: NoFantasy --- src/game/CreatureAI.h | 3 +++ src/game/SpellEffects.cpp | 6 ++++++ src/shared/revision_nr.h | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h index c6734548d..ee2bfa27d 100644 --- a/src/game/CreatureAI.h +++ b/src/game/CreatureAI.h @@ -106,6 +106,9 @@ class MANGOS_DLL_SPEC CreatureAI // Called when the creature summon successfully other creature virtual void JustSummoned(Creature* ) {} + // Called when the creature summon successfully a gameobject + virtual void JustSummoned(GameObject* ) {} + // Called when the creature summon despawn virtual void SummonedCreatureDespawn(Creature* /*unit*/) {} diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 5706aa45e..9ca474775 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -6156,6 +6156,9 @@ void Spell::EffectSummonObjectWild(SpellEffectIndex eff_idx) } pGameObj->SummonLinkedTrapIfAny(); + + if (m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->AI()) + ((Creature*)m_caster)->AI()->JustSummoned(pGameObj); } void Spell::EffectScriptEffect(SpellEffectIndex eff_idx) @@ -8696,6 +8699,9 @@ void Spell::EffectTransmitted(SpellEffectIndex eff_idx) cMap->Add(pGameObj); pGameObj->SummonLinkedTrapIfAny(); + + if (m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->AI()) + ((Creature*)m_caster)->AI()->JustSummoned(pGameObj); } void Spell::EffectProspecting(SpellEffectIndex /*eff_idx*/) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 3a06b4d95..8bc164ab5 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11417" + #define REVISION_NR "11418" #endif // __REVISION_NR_H__