summaryrefslogtreecommitdiffstats
path: root/src/Mobs
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-05-04 21:25:54 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-05-04 21:25:54 +0200
commit213a96e6d6373dc2a015a165d5309c20d460665d (patch)
treefad1c56ad379ced744955ae50e69715c49c40231 /src/Mobs
parentFixed ProtoProxy compilation in MSVC2013. (diff)
parentFixed 027efe09ea3d3222c3cbf169643e57773c1614ae (diff)
downloadcuberite-213a96e6d6373dc2a015a165d5309c20d460665d.tar
cuberite-213a96e6d6373dc2a015a165d5309c20d460665d.tar.gz
cuberite-213a96e6d6373dc2a015a165d5309c20d460665d.tar.bz2
cuberite-213a96e6d6373dc2a015a165d5309c20d460665d.tar.lz
cuberite-213a96e6d6373dc2a015a165d5309c20d460665d.tar.xz
cuberite-213a96e6d6373dc2a015a165d5309c20d460665d.tar.zst
cuberite-213a96e6d6373dc2a015a165d5309c20d460665d.zip
Diffstat (limited to 'src/Mobs')
-rw-r--r--src/Mobs/AggressiveMonster.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/Mobs/AggressiveMonster.cpp b/src/Mobs/AggressiveMonster.cpp
index 447bf3549..85b122034 100644
--- a/src/Mobs/AggressiveMonster.cpp
+++ b/src/Mobs/AggressiveMonster.cpp
@@ -108,14 +108,13 @@ void cAggressiveMonster::Attack(float a_Dt)
bool cAggressiveMonster::IsMovingToTargetPosition()
{
- static const float epsilon = 0.000000000001f;
// Difference between destination x and target x is negligible (to 10^-12 precision)
- if (fabsf((float)m_FinalDestination.x - (float)m_Target->GetPosX()) < epsilon)
+ if (fabsf((float)m_FinalDestination.x - (float)m_Target->GetPosX()) < std::numeric_limits<float>::epsilon())
{
return false;
}
// Difference between destination z and target z is negligible (to 10^-12 precision)
- else if (fabsf((float)m_FinalDestination.z - (float)m_Target->GetPosZ()) > epsilon)
+ else if (fabsf((float)m_FinalDestination.z - (float)m_Target->GetPosZ()) > std::numeric_limits<float>::epsilon())
{
return false;
}