[10535] Add optional argument to SummonCreature, summon as active object

When true, the summoned will be able to load grids as needed.

Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
NoFantasy 2010-09-25 13:16:59 +02:00
parent b531bcfee1
commit 88fca158f8
3 changed files with 6 additions and 3 deletions

View file

@ -1697,7 +1697,7 @@ void WorldObject::AddObjectToRemoveList()
GetMap()->AddObjectToRemoveList(this);
}
Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, float ang,TempSummonType spwtype,uint32 despwtime)
Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, float ang,TempSummonType spwtype,uint32 despwtime, bool asActiveObject)
{
TemporarySummon* pCreature = new TemporarySummon(GetObjectGuid());
@ -1724,6 +1724,9 @@ Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, floa
return NULL;
}
// Active state set before added to map
pCreature->SetActiveObjectState(asActiveObject);
pCreature->Summon(spwtype, despwtime);
if(GetTypeId()==TYPEID_UNIT && ((Creature*)this)->AI())