From f6350662414044896e7971dcc792c83d5eaddbce Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 4 Jul 2014 12:50:40 +0100 Subject: Eps comparison --- src/Entities/ArrowEntity.cpp | 2 +- src/Entities/ArrowEntity.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Entities') diff --git a/src/Entities/ArrowEntity.cpp b/src/Entities/ArrowEntity.cpp index c039b0b3c..1d539679c 100644 --- a/src/Entities/ArrowEntity.cpp +++ b/src/Entities/ArrowEntity.cpp @@ -68,7 +68,7 @@ bool cArrowEntity::CanPickup(const cPlayer & a_Player) const void cArrowEntity::OnHitSolidBlock(const Vector3d & a_HitPos, eBlockFace a_HitFace) { - if (GetSpeed().SqrLength() == 0) + if (GetSpeed().EqualsEps(Vector3d(0, 0, 0), 0.0000001)) { SetSpeed(GetLookVector().NormalizeCopy() * 0.1); // Ensure that no division by zero happens later } diff --git a/src/Entities/ArrowEntity.h b/src/Entities/ArrowEntity.h index 99b7bae31..76cb24449 100644 --- a/src/Entities/ArrowEntity.h +++ b/src/Entities/ArrowEntity.h @@ -64,7 +64,7 @@ public: // tolua_end - /** Sets the block arrow is in */ + /** Sets the block arrow is in. To be used by the MCA loader only! */ void SetBlockHit(const Vector3i & a_BlockHit) { m_HitBlockPos = a_BlockHit; } protected: -- cgit v1.2.3