mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-20 01:15:35 +01:00
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:
@@ -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())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user