diff options
Diffstat (limited to 'src/game/Object.cpp')
-rw-r--r-- | src/game/Object.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 18f4375dbeb..83a64262d24 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -82,16 +82,16 @@ Object::Object( ) Object::~Object( ) { - if(m_objectUpdated) - ObjectAccessor::Instance().RemoveUpdateObject(this); + //if(m_objectUpdated) + // ObjectAccessor::Instance().RemoveUpdateObject(this); if(m_uint32Values) { if(IsInWorld()) { ///- Do NOT call RemoveFromWorld here, if the object is a player it will crash - sLog.outError("Object::~Object - guid="I64FMTD", typeid=%d deleted but still in world!!", GetGUID(), GetTypeId()); - //assert(0); + sLog.outCrash("Object::~Object - guid="I64FMTD", typeid=%d deleted but still in world!!", GetGUID(), GetTypeId()); + assert(false); } //DEBUG_LOG("Object desctr 1 check (%p)",(void*)this); @@ -1893,7 +1893,10 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float Map *map = GetMap(); GameObject *go = new GameObject(); if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), entry, map, GetPhaseMask(), x,y,z,ang,rotation0,rotation1,rotation2,rotation3,100,1)) + { + delete go; return NULL; + } go->SetRespawnTime(respawnTime); if(GetTypeId()==TYPEID_PLAYER || GetTypeId()==TYPEID_UNIT) //not sure how to handle this ((Unit*)this)->AddGameObject(go); |