mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[8054] First do cleanup then removefromworld for player.
Signed-off-by: VladimirMangos <vladimir@getmangos.com> Thanks to lordinpvp for patch prepering for mangos.
This commit is contained in:
parent
d56de2cd77
commit
a8dea60d6e
2 changed files with 9 additions and 9 deletions
|
|
@ -367,6 +367,14 @@ void WorldSession::LogoutPlayer(bool Save)
|
|||
if(_player->GetGroup() && !_player->GetGroup()->isRaidGroup() && m_Socket)
|
||||
_player->RemoveFromGroup();
|
||||
|
||||
///- Send update to group
|
||||
if(_player->GetGroup())
|
||||
_player->GetGroup()->SendUpdate();
|
||||
|
||||
///- Broadcast a logout message to the player's friends
|
||||
sSocialMgr.SendFriendStatus(_player, FRIEND_OFFLINE, _player->GetGUIDLow(), true);
|
||||
sSocialMgr.RemovePlayerSocial (_player->GetGUIDLow ());
|
||||
|
||||
///- Remove the player from the world
|
||||
// the player may not be in the world when logging out
|
||||
// e.g if he got disconnected during a transfer to another map
|
||||
|
|
@ -375,17 +383,9 @@ void WorldSession::LogoutPlayer(bool Save)
|
|||
// RemoveFromWorld does cleanup that requires the player to be in the accessor
|
||||
ObjectAccessor::Instance().RemoveObject(_player);
|
||||
|
||||
///- Send update to group
|
||||
if(_player->GetGroup())
|
||||
_player->GetGroup()->SendUpdate();
|
||||
|
||||
///- Broadcast a logout message to the player's friends
|
||||
sSocialMgr.SendFriendStatus(_player, FRIEND_OFFLINE, _player->GetGUIDLow(), true);
|
||||
|
||||
///- Delete the player object
|
||||
_player->CleanupsBeforeDelete(); // do some cleanup before deleting to prevent crash at crossreferences to already deleted data
|
||||
|
||||
sSocialMgr.RemovePlayerSocial (_player->GetGUIDLow ());
|
||||
delete _player;
|
||||
_player = NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8053"
|
||||
#define REVISION_NR "8054"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue