mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[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:
parent
dc10620148
commit
9f41772828
15 changed files with 19 additions and 32 deletions
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue