mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 09:44:45 +01:00
[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:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user