[9506] Add missing AI calls to inform summoner of summon-related events

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-03-03 00:24:34 +01:00
parent 3a5f6ff0fb
commit d775eea9a4
4 changed files with 20 additions and 2 deletions

View file

@ -23,6 +23,7 @@
#include "Player.h"
#include "ObjectMgr.h"
#include "SpellMgr.h"
#include "CreatureAI.h"
Totem::Totem() : Creature(CREATURE_SUBTYPE_TOTEM)
{
@ -67,6 +68,9 @@ void Totem::Summon(Unit* owner)
AIM_Initialize();
if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
((Creature*)owner)->AI()->JustSummoned((Creature*)this);
// there are some totems, which exist just for their visual appeareance
if (!GetSpell())
return;
@ -109,6 +113,9 @@ void Totem::UnSummon()
}
}
}
if (owner->GetTypeId() == TYPEID_UNIT && ((Creature*)owner)->AI())
((Creature*)owner)->AI()->SummonedCreatureDespawn((Creature*)this);
}
AddObjectToRemoveList();