diff options
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5ff00d80976..b42177f62c0 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -12892,7 +12892,8 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel return false; } - bool const turn = (GetOrientation() != orientation); + // Check if angular distance changed + bool const turn = G3D::fuzzyGt(M_PI - fabs(fabs(GetOrientation() - orientation) - M_PI), 0.0f); // G3D::fuzzyEq won't help here, in some cases magnitudes differ by a little more than G3D::eps, but should be considered equal bool const relocated = (teleport || |