Core/Objects: Encapsulated Postion::m_orientation field to ensure it is always normalized to 0-2pi range

Closes #7400.
This commit is contained in:
teyrnon authored and Shauren committed 2012-08-20 10:44:14 +02:00
1 parent 69cfc0f7bf
commit 6cea446f22
14 files changed
+46 -52

No files matched your search

+1 -2
View File
@@ -407,7 +407,7 @@ void Unit::UpdateSplinePosition()
pos.m_positionX = loc.x;
pos.m_positionY = loc.y;
pos.m_positionZ = loc.z;
pos.m_orientation = loc.orientation;
pos.SetOrientation(loc.orientation);
if (Unit* vehicle = GetVehicleBase())
{
loc.x += vehicle->GetPositionX();
@@ -16722,7 +16722,6 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel
return false;
}
orientation = MapManager::NormalizeOrientation(orientation);
bool turn = (GetOrientation() != orientation);
bool relocated = (teleport || GetPositionX() != x || GetPositionY() != y || GetPositionZ() != z);