From 9a7746c9fcfe97edb044bde559b14d09d12f8e13 Mon Sep 17 00:00:00 2001 From: QAston Date: Mon, 18 Jan 2010 18:42:36 +0100 Subject: *Add some debug info to trac reason of assertion fail in Unit destructor. --HG-- branch : trunk --- src/game/Level2.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/game/Level2.cpp') diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index 401d1a75c39..b15497e3d3b 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -1014,6 +1014,7 @@ bool ChatHandler::HandleNpcAddCommand(const char* args) Creature* pCreature = new Creature; if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, (uint32)teamval, x, y, z, o)) { + pCreature->CleanupsBeforeDelete(); delete pCreature; return false; } @@ -2830,6 +2831,7 @@ bool ChatHandler::HandleWpModifyCommand(const char* args) Creature* wpCreature2 = new Creature; if (!wpCreature2->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), VISUAL_WAYPOINT, 0, 0, chr->GetPositionX(), chr->GetPositionY(), chr->GetPositionZ(), chr->GetOrientation())) { + wpCreature2->CleanupsBeforeDelete(); PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, VISUAL_WAYPOINT); delete wpCreature2; return false; @@ -3039,6 +3041,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args) Creature* wpCreature = new Creature; if (!wpCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o)) { + wpCreature->CleanupsBeforeDelete(); PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id); delete wpCreature; delete result; @@ -3094,6 +3097,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args) Creature* pCreature = new Creature; if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT),map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o)) { + pCreature->CleanupsBeforeDelete(); PSendSysMessage(LANG_WAYPOINT_VP_NOTCREATED, id); delete pCreature; delete result; @@ -3149,6 +3153,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args) Creature* pCreature = new Creature; if (!pCreature->Create(objmgr.GenerateLowGuid(HIGHGUID_UNIT), map, chr->GetPhaseMaskForSpawn(), id, 0, 0, x, y, z, o)) { + pCreature->CleanupsBeforeDelete(); PSendSysMessage(LANG_WAYPOINT_NOTCREATED, id); delete pCreature; delete result; -- cgit v1.2.3