summaryrefslogtreecommitdiffstats
path: root/src/Mobs
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-04-27 18:35:41 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-04-27 18:35:41 +0200
commitbbc5faa723b7dd63250949f7b28601ffd748e2f5 (patch)
treee74901e581237b889cd8d7ccfaaf376f8b616508 /src/Mobs
parentMerge pull request #941 from archshift/master (diff)
downloadcuberite-bbc5faa723b7dd63250949f7b28601ffd748e2f5.tar
cuberite-bbc5faa723b7dd63250949f7b28601ffd748e2f5.tar.gz
cuberite-bbc5faa723b7dd63250949f7b28601ffd748e2f5.tar.bz2
cuberite-bbc5faa723b7dd63250949f7b28601ffd748e2f5.tar.lz
cuberite-bbc5faa723b7dd63250949f7b28601ffd748e2f5.tar.xz
cuberite-bbc5faa723b7dd63250949f7b28601ffd748e2f5.tar.zst
cuberite-bbc5faa723b7dd63250949f7b28601ffd748e2f5.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 3e5f72dbf..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()
{
- float epsilon = 0.000000000001;
// 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(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;
}