Core/Player: Resequence Player::UpdateZone some more to hopefully prevent future edge cases like #20289 from occurring.

This commit is contained in:
Aokromes committed 2017-09-10 15:37:49 +02:00
1 parent 46657cca71
commit 2fc3ddec1d
1 file changed
+13 -14
+13 -14
View File
@@ -7396,24 +7396,10 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
{
GetMap()->UpdatePlayerZoneStats(m_zoneUpdateId, newZone);
if (m_zoneUpdateId != newZone)
{
sOutdoorPvPMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId);
sOutdoorPvPMgr->HandlePlayerEnterZone(this, newZone);
sBattlefieldMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId);
sBattlefieldMgr->HandlePlayerEnterZone(this, newZone);
SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange...
if (Guild* guild = GetGuild())
guild->UpdateMemberData(this, GUILD_MEMBER_DATA_ZONEID, newZone);
}
// group update
if (GetGroup())
SetGroupUpdateFlag(GROUP_UPDATE_FULL);
m_zoneUpdateId = newZone;
m_zoneUpdateTimer = ZONE_UPDATE_INTERVAL;
// zone changed, so area changed as well, update it
UpdateArea(newArea);
@@ -7479,6 +7465,19 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
UpdateZoneDependentAuras(newZone);
m_zoneUpdateTimer = ZONE_UPDATE_INTERVAL;
if (m_zoneUpdateId != newZone)
{
m_zoneUpdateId = newZone;
sOutdoorPvPMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId);
sOutdoorPvPMgr->HandlePlayerEnterZone(this, newZone);
sBattlefieldMgr->HandlePlayerLeaveZone(this, m_zoneUpdateId);
sBattlefieldMgr->HandlePlayerEnterZone(this, newZone);
SendInitWorldStates(newZone, newArea); // only if really enters to new zone, not just area change, works strange...
if (Guild* guild = GetGuild())
guild->UpdateMemberData(this, GUILD_MEMBER_DATA_ZONEID, newZone);
}
UpdateAreaPhase();
}