mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +00:00
[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:
parent
b531bcfee1
commit
88fca158f8
3 changed files with 6 additions and 3 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue