From 88fca158f8b2dca8e537a061ac1bb385151c56e4 Mon Sep 17 00:00:00 2001 From: NoFantasy Date: Sat, 25 Sep 2010 13:16:59 +0200 Subject: [PATCH] [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 --- src/game/Object.cpp | 5 ++++- src/game/Object.h | 2 +- src/shared/revision_nr.h | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 605ca7003..fd55717b4 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -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()) diff --git a/src/game/Object.h b/src/game/Object.h index 336d123b2..08b4b94c5 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -486,7 +486,7 @@ class MANGOS_DLL_SPEC WorldObject : public Object void RemoveFromClientUpdateList(); void BuildUpdateData(UpdateDataMapType &); - Creature* SummonCreature(uint32 id, float x, float y, float z, float ang,TempSummonType spwtype,uint32 despwtime); + Creature* SummonCreature(uint32 id, float x, float y, float z, float ang,TempSummonType spwtype,uint32 despwtime, bool asActiveObject = false); bool isActiveObject() const { return m_isActiveObject || m_viewPoint.hasViewers(); } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index d4021701c..3192f7cda 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 "10534" + #define REVISION_NR "10535" #endif // __REVISION_NR_H__