diff options
author | xinef1 <w.szyszko2@gmail.com> | 2017-01-21 14:49:06 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2018-12-09 14:18:42 +0100 |
commit | 4afee01b0186da0533905eabfbded5a25a3992b5 (patch) | |
tree | f62625f1b43fef2adb94e621ea981059e55ad0d9 /src | |
parent | 8573b651c8bb00612b161cc44664cbbb6dd16327 (diff) |
Core/Auras: Prevent remove of auras interrupted by turning if the turn could be caused by float calculation error (#18595)
(cherry-picked from 38f9919a37e0a3f17c454d4353d9ff2b79382e6b)
Diffstat (limited to 'src')
-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 || |