Core/Player: Update map zone stats BEFORE invoking scripts. Fixes a crash with zone change scripts that invoke another zone change. Closes #20289.

(cherry picked from commit dbabcfbe24)
This commit is contained in:
Treeston
2017-09-09 21:32:21 +02:00
committed by Shauren
parent e856bedd92
commit 8db10c67d7

View File

@@ -7153,6 +7153,8 @@ void Player::UpdateArea(uint32 newArea)
void Player::UpdateZone(uint32 newZone, uint32 newArea)
{
GetMap()->UpdatePlayerZoneStats(m_zoneUpdateId, newZone);
if (m_zoneUpdateId != newZone)
{
sOutdoorPvPMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId);
@@ -7164,8 +7166,6 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
guild->UpdateMemberData(this, GUILD_MEMBER_DATA_ZONEID, newZone);
}
GetMap()->UpdatePlayerZoneStats(m_zoneUpdateId, newZone);
// group update
if (GetGroup())
{