1
0

Eps comparison

This commit is contained in:
Tiger Wang 2014-07-04 12:50:40 +01:00
parent 89a26cc786
commit f635066241
2 changed files with 2 additions and 2 deletions

View File

@ -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
}

View File

@ -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: