From 38f9919a37e0a3f17c454d4353d9ff2b79382e6b Mon Sep 17 00:00:00 2001 From: xinef1 Date: Sat, 21 Jan 2017 14:49:06 +0100 Subject: Core/Auras: Prevent remove of auras interrupted by turning if the turn could be caused by float calculation error (#18595) --- src/server/game/Entities/Unit/Unit.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index eefed9e97e4..f31117d30aa 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13510,7 +13510,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 || -- cgit v1.2.3