Core/Objects: Properly choose between "Destroyed" or "OutOfRange" during visibility update

Port From (https://github.com/TrinityCore/TrinityCore/commit/5a82a0381d704e4b4b9976daf04d541d1130e541)
This commit is contained in:
hondacrx
2022-03-09 12:33:25 -05:00
parent 510a1a0208
commit e65a1e95cf
6 changed files with 31 additions and 10 deletions
+2 -1
View File
@@ -209,7 +209,8 @@ namespace Game
// 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
GetPlayer().CleanupsBeforeDelete();
_player.SetDestroyedObject(true);
_player.CleanupsBeforeDelete();
Log.outInfo(LogFilter.Player, $"Account: {GetAccountId()} (IP: {GetRemoteAddress()}) Logout Character:[{_player.GetName()}] ({_player.GetGUID()}) Level: {_player.GetLevel()}, XP: {_player.GetXP()}/{_player.GetXPForNextLevel()} ({_player.GetXPForNextLevel() - _player.GetXP()} left)");
Map map = GetPlayer().GetMap();