diff options
| author | megamage <none@none> | 2009-07-16 11:49:00 +0800 |
|---|---|---|
| committer | megamage <none@none> | 2009-07-16 11:49:00 +0800 |
| commit | 208087ff6ee592150b1ed387bbc135566a02a359 (patch) | |
| tree | 42b3b460ce2276259e2673bc8b254e0812af1fbb /src/game/WorldSession.cpp | |
| parent | 762528c5dd7908de47f2c2a7dcc5e7c95eb79744 (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.cpp | 9 |
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 ); |
