aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorxinef1 <w.szyszko2@gmail.com>2017-01-21 14:49:06 +0100
committerShauren <shauren.trinity@gmail.com>2017-01-21 14:49:06 +0100
commit38f9919a37e0a3f17c454d4353d9ff2b79382e6b (patch)
tree910e6e1cfbe3cd4197b8467eae0b2691e8b71168 /src
parentba6281bf429384a506aad5125bcc537eef5bfe77 (diff)
Core/Auras: Prevent remove of auras interrupted by turning if the turn could be caused by float calculation error (#18595)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp3
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 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 ||