From 8591dd589ae3b4d4f5ef55673ab83015cb599bdd Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 24 Aug 2020 23:39:03 -0400 Subject: [PATCH] Core/Player: Update map zone stats BEFORE invoking scripts. Fixes a crash with zone change scripts that invoke another zone change. Port From (https://github.com/TrinityCore/TrinityCore/commit/8db10c67d7232b7b1e479018cfbf020a3a91fa5c) --- Source/Game/Entities/Player/Player.Map.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Game/Entities/Player/Player.Map.cs b/Source/Game/Entities/Player/Player.Map.cs index f0518800e..746d3d454 100644 --- a/Source/Game/Entities/Player/Player.Map.cs +++ b/Source/Game/Entities/Player/Player.Map.cs @@ -148,6 +148,8 @@ namespace Game.Entities public void UpdateZone(uint newZone, uint newArea) { + GetMap().UpdatePlayerZoneStats(m_zoneUpdateId, newZone); + if (m_zoneUpdateId != newZone) { Global.OutdoorPvPMgr.HandlePlayerLeaveZone(this, m_zoneUpdateId); @@ -160,8 +162,6 @@ namespace Game.Entities guild.UpdateMemberData(this, GuildMemberData.ZoneId, newZone); } - GetMap().UpdatePlayerZoneStats(m_zoneUpdateId, newZone); - // group update if (GetGroup()) {