From 1df7dbe7c91953c2413908b846649e884b7ac53c Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 5 May 2014 23:45:35 +0100 Subject: Suggestions'd --- src/Entities/Entity.cpp | 2 +- src/Entities/Player.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Entities') diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 644afe69e..4cf10a219 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -1211,7 +1211,7 @@ void cEntity::BroadcastMovementUpdate(const cClientHandle * a_Exclude) int DiffY = (int)(floor(GetPosY() * 32.0) - floor(m_LastPos.y * 32.0)); int DiffZ = (int)(floor(GetPosZ() * 32.0) - floor(m_LastPos.z * 32.0)); - if ((abs(DiffX) != 0) || (abs(DiffY) != 0) || (abs(DiffZ) != 0)) // Have we moved? + if ((DiffX != 0) || (DiffY != 0) || (DiffZ != 0)) // Have we moved? { if ((abs(DiffX) <= 127) && (abs(DiffY) <= 127) && (abs(DiffZ) <= 127)) // Limitations of a Byte { diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index bcbf58623..d63e5461a 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -212,7 +212,7 @@ void cPlayer::Tick(float a_Dt, cChunk & a_Chunk) SendExperience(); } - if ((GetPosition() - m_LastPos).SqrLength() != 0.0) // Change in position from last tick? + if (!(GetPosition() - m_LastPos).Equals(Vector3d(0, 0, 0))) // Change in position from last tick? { // Apply food exhaustion from movement: ApplyFoodExhaustionFromMovement(); -- cgit v1.2.3