From 30eedaa72d0873489464239f636c0705a7459b06 Mon Sep 17 00:00:00 2001 From: megamage Date: Wed, 1 Apr 2009 21:17:59 -0600 Subject: *Try to fix some crash. --HG-- branch : trunk --- src/game/Object.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/game/Object.cpp') 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); -- cgit v1.2.3