diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-05-04 21:25:54 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-05-04 21:25:54 +0200 |
commit | 213a96e6d6373dc2a015a165d5309c20d460665d (patch) | |
tree | fad1c56ad379ced744955ae50e69715c49c40231 /src/Mobs | |
parent | Fixed ProtoProxy compilation in MSVC2013. (diff) | |
parent | Fixed 027efe09ea3d3222c3cbf169643e57773c1614ae (diff) | |
download | cuberite-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.cpp | 5 |
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; } |