mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 07:37:03 +00:00
[8182] Store and use Map* pointer in WorldObject instead map ids for speedup
Also some code logic cleanups. Changes let make more cleanups in base map access and other places, but this chnages not inlcuded in patch. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
fcb34b3928
commit
58209ee79a
25 changed files with 180 additions and 193 deletions
|
|
@ -385,15 +385,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 the player object
|
||||
_player->CleanupsBeforeDelete(); // do some cleanup before deleting to prevent crash at crossreferences to already deleted data
|
||||
|
||||
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 );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue