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)
This commit is contained in:
hondacrx
2020-08-24 23:39:03 -04:00
parent 3dee2ddf3b
commit 8591dd589a
+2 -2
View File
@@ -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())
{