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

* Call it from Map::AddObjectToRemoveList and remove now not needed explcit calls
* Create Gameobject version to make GO with owner more safe for remove
This commit is contained in:
VladimirMangos 2009-07-01 11:05:55 +04:00 committed by tomrus88
parent 91f26272ec
commit a8288b311e
15 changed files with 19 additions and 32 deletions

View file

@ -880,7 +880,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);
}
}
@ -2048,6 +2047,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());
}