summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ClientHandle.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index ce6d4c981..351e7203a 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -839,8 +839,28 @@ void cClientHandle::HandlePlayerPos(double a_PosX, double a_PosY, double a_PosZ,
Vector3d NewPosition(a_PosX, a_PosY, a_PosZ);
Vector3d OldPosition = GetPlayer()->GetPosition();
+ double OldStance = GetPlayer()->GetStance();
auto PreviousIsOnGround = GetPlayer()->IsOnGround();
+ #ifdef __clang__
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wfloat-equal"
+ #endif
+
+ if (
+ (OldPosition == NewPosition) &&
+ (OldStance == a_Stance) &&
+ (PreviousIsOnGround == a_IsOnGround)
+ )
+ {
+ // Nothing changed, no need to do anything
+ return;
+ }
+
+ #ifdef __clang__
+ #pragma clang diagnostic pop
+ #endif
+
// If the player has moved too far, "repair" them:
if ((OldPosition - NewPosition).SqrLength() > 100 * 100)
{