aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp9
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 a39c25327c0..6dbad26a75d 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -13035,8 +13035,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)