From 208087ff6ee592150b1ed387bbc135566a02a359 Mon Sep 17 00:00:00 2001 From: megamage Date: Thu, 16 Jul 2009 11:49:00 +0800 Subject: [8182] Store and use Map* pointer in WorldObject instead map ids for speedup Author: Ambal Also some code logic cleanups. Changes let make more cleanups in base map access and other places, but this chnages not inlcuded in patch. *This patch may cause crash. --HG-- branch : trunk --- src/game/WorldSession.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/game/WorldSession.cpp') diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index 2b905ea835f..c2191ed3e10 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -391,12 +391,9 @@ void WorldSession::LogoutPlayer(bool Save) // the player may not be in the world when logging out // e.g if he got disconnected during a transfer to another map // calls to GetMap in this case may cause crashes - if(_player->IsInWorld()) _player->GetMap()->Remove(_player, false); - // RemoveFromWorld does cleanup that requires the player to be in the accessor - ObjectAccessor::Instance().RemoveObject(_player); - - delete _player; - _player = NULL; + Map* _map = _player->GetMap(); + _map->Remove(_player, true); + _player = NULL; // deleted in Remove call ///- Send the 'logout complete' packet to the client WorldPacket data( SMSG_LOGOUT_COMPLETE, 0 ); -- cgit v1.2.3