diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index d63e5461a..6ac11c270 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).Equals(Vector3d(0, 0, 0))) // Change in position from last tick? + if (GetPosition() != m_LastPos) // Change in position from last tick? { // Apply food exhaustion from movement: ApplyFoodExhaustionFromMovement(); diff --git a/src/Vector3.h b/src/Vector3.h index 2c79f9ff1..181160ba7 100644 --- a/src/Vector3.h +++ b/src/Vector3.h @@ -113,6 +113,11 @@ public: return Equals(a_Rhs); } + inline bool operator != (const Vector3 & a_Rhs) const + { + return !Equals(a_Rhs); + } + inline bool operator < (const Vector3 & a_Rhs) { // return (x < a_Rhs.x) && (y < a_Rhs.y) && (z < a_Rhs.z); ?