[8102] Simplify code base at new root method WorldObject::CleanupsBeforeDelete Author: VladimirMangos

* Call it from Map::AddObjectToRemoveList and remove now not needed explcit calls
    * Create Gameobject version to make GO with owner more safe for remove

--HG--
branch : trunk
This commit is contained in:
megamage
2009-07-01 18:23:36 -05:00
parent 9a2588a454
commit 111dac5f94
14 changed files with 20 additions and 23 deletions

View File

@@ -1010,7 +1010,6 @@ void Map::MoveAllCreaturesInMoveList()
if((sLog.getLogFilter() & LOG_FILTER_CREATURE_MOVES)==0)
sLog.outDebug("Creature (GUID: %u Entry: %u ) can't be move to unloaded respawn grid.",c->GetGUIDLow(),c->GetEntry());
#endif
c->CleanupsBeforeDelete();
AddObjectToRemoveList(c);
}
}
@@ -2151,6 +2150,8 @@ void Map::AddObjectToRemoveList(WorldObject *obj)
{
assert(obj->GetMapId()==GetId() && obj->GetInstanceId()==GetInstanceId());
obj->CleanupsBeforeDelete(); // remove or simplify at least cross referenced links
i_objectsToRemove.insert(obj);
//sLog.outDebug("Object (GUID: %u TypeId: %u ) added to removing list.",obj->GetGUIDLow(),obj->GetTypeId());
}