Core/Entities: don't absolute compare positions on UpdatePosition
Closes #18415
This commit is contained in:
1 parent
eb3a90a4e8
commit
1d3fddfc6a
1 file changed
+7
-2
@@ -16214,8 +16214,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)
|
||||
|
||||
Reference in new issue
Block a user