aboutsummaryrefslogtreecommitdiff
path: root/src/game/WorldSession.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-07-16 11:49:00 +0800
committermegamage <none@none>2009-07-16 11:49:00 +0800
commit208087ff6ee592150b1ed387bbc135566a02a359 (patch)
tree42b3b460ce2276259e2673bc8b254e0812af1fbb /src/game/WorldSession.cpp
parent762528c5dd7908de47f2c2a7dcc5e7c95eb79744 (diff)
[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
Diffstat (limited to 'src/game/WorldSession.cpp')
-rw-r--r--src/game/WorldSession.cpp9
1 files changed, 3 insertions, 6 deletions
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 );