[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
parent dc10620148
commit 9f41772828
15 changed files with 19 additions and 32 deletions

View file

@ -1053,6 +1053,10 @@ WorldObject::WorldObject()
{
}
void WorldObject::CleanupsBeforeDelete()
{
}
void WorldObject::_Create( uint32 guidlow, HighGuid guidhigh, uint32 mapid, uint32 phaseMask )
{
Object::_Create(guidlow, 0, guidhigh);
@ -1546,14 +1550,7 @@ Map const* WorldObject::GetBaseMap() const
void WorldObject::AddObjectToRemoveList()
{
Map* map = GetMap();
if(!map)
{
sLog.outError("Object (TypeId: %u Entry: %u GUID: %u) at attempt add to move list not have valid map (Id: %u).",GetTypeId(),GetEntry(),GetGUIDLow(),GetMapId());
return;
}
map->AddObjectToRemoveList(this);
GetMap()->AddObjectToRemoveList(this);
}
Creature* WorldObject::SummonCreature(uint32 id, float x, float y, float z, float ang,TempSummonType spwtype,uint32 despwtime)