fix(Core/Players): Update the player's zone and area only after update the player's position server-side (#9419)

This commit is contained in:
schell244
2021-12-10 01:58:43 +01:00
committed by GitHub
parent 85d2c39a48
commit 39355fa1ee
4 changed files with 17 additions and 4 deletions

View File

@@ -1115,6 +1115,15 @@ bool Player::UpdatePosition(float x, float y, float z, float orientation,
if (!Unit::UpdatePosition(x, y, z, orientation, teleport))
return false;
// Update player zone if needed
if (m_needZoneUpdate)
{
uint32 newZone, newArea;
GetZoneAndAreaId(newZone, newArea);
UpdateZone(newZone, newArea);
m_needZoneUpdate = false;
}
if (GetGroup())
SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION);