*ResetMap for worldobjects when map is deleted.
--HG-- branch : trunk
This commit is contained in:
1 parent
9403ff03e7
commit
962b88a381
4 files changed
+29
-5
No files matched your search
+19
-2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user