diff options
author | megamage <none@none> | 2009-08-11 16:33:33 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-08-11 16:33:33 -0500 |
commit | 962b88a381cd7c051378ab10e783511af734b9bf (patch) | |
tree | cd30fccd45c5a2f675b4620760f30ee04667628d /src/game/Object.cpp | |
parent | 9403ff03e792154b5709a05d8dfdd7da123ce9b5 (diff) |
*ResetMap for worldobjects when map is deleted.
--HG--
branch : trunk
Diffstat (limited to 'src/game/Object.cpp')
-rw-r--r-- | src/game/Object.cpp | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 681a5da6d44..4c100328adb 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -80,6 +80,18 @@ Object::Object( ) : m_PackGUID(sizeof(uint64)+1) m_PackGUID.appendPackGUID(0); } +/* +WorldObject::~WorldObject() +{ + if(m_currMap) + { + sLog.outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in map!!", GetGUID(), GetTypeId(), GetEntry()); + assert(false); + ResetMap(); + } +} +*/ + Object::~Object( ) { if(IsInWorld()) @@ -1692,14 +1704,19 @@ void WorldObject::SendObjectDeSpawnAnim(uint64 guid) void WorldObject::SetMap(Map * map) { ASSERT(map); - ASSERT(!IsInWorld() || GetTypeId() == TYPEID_CORPSE); + //ASSERT(!IsInWorld()); + ASSERT(!m_currMap); m_currMap = map; + if(m_isWorldObject) + m_currMap->AddWorldObject(this); } void WorldObject::ResetMap() { ASSERT(m_currMap); - ASSERT(!IsInWorld() || GetTypeId() == TYPEID_CORPSE); + //ASSERT(!IsInWorld() || GetTypeId() == TYPEID_CORPSE); + if(m_isWorldObject) + m_currMap->RemoveWorldObject(this); m_currMap = NULL; } |