[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

@@ -1377,7 +1377,6 @@ bool ChatHandler::HandleNpcDeleteCommand(const char* args)
// Delete the creature
unit->CombatStop();
unit->DeleteFromDB();
unit->CleanupsBeforeDelete();
unit->AddObjectToRemoveList();
SendSysMessage(LANG_COMMAND_DELCREATMESSAGE);
@@ -3449,7 +3448,6 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
Field *fields = result->Fetch();
uint32 guid = fields[0].GetUInt32();
Creature* pCreature = m_session->GetPlayer()->GetMap()->GetCreature(MAKE_NEW_GUID(guid,VISUAL_WAYPOINT,HIGHGUID_UNIT));
if(!pCreature)
{
PSendSysMessage(LANG_WAYPOINT_NOTREMOVED, guid);