diff options
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 4b73c4a0dcc..6fa241b39e6 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13568,8 +13568,13 @@ bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool tel return false; } - bool turn = (GetOrientation() != orientation); - bool relocated = (teleport || GetPositionX() != x || GetPositionY() != y || GetPositionZ() != z); + bool const turn = (GetOrientation() != orientation); + + // 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 || + std::fabs(GetPositionX() - x) > 0.001f || + std::fabs(GetPositionY() - y) > 0.001f || + std::fabs(GetPositionZ() - z) > 0.001f); // TODO: Check if orientation transport offset changed instead of only global orientation if (turn) |