summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorMat <mail@mathias.is>2020-03-21 13:57:19 +0100
committerGitHub <noreply@github.com>2020-03-21 13:57:19 +0100
commit0de2a323654a47d19629e78cd2c67a1bcff635ea (patch)
tree3d21e3f5a16a10d2b1900365df5c802cbefdb18e /src/ClientHandle.cpp
parentUpdate Core (diff)
downloadcuberite-0de2a323654a47d19629e78cd2c67a1bcff635ea.tar
cuberite-0de2a323654a47d19629e78cd2c67a1bcff635ea.tar.gz
cuberite-0de2a323654a47d19629e78cd2c67a1bcff635ea.tar.bz2
cuberite-0de2a323654a47d19629e78cd2c67a1bcff635ea.tar.lz
cuberite-0de2a323654a47d19629e78cd2c67a1bcff635ea.tar.xz
cuberite-0de2a323654a47d19629e78cd2c67a1bcff635ea.tar.zst
cuberite-0de2a323654a47d19629e78cd2c67a1bcff635ea.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-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)
{