diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-05-06 21:15:19 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-05-06 21:15:19 +0200 |
commit | 696a7bc52e9b029b627feee76eaf5e1239417033 (patch) | |
tree | ac3e5152dd6e7eb2a9420daad8df3bb2560d544f /src/Mobs | |
parent | Suggestions'd #2 (diff) | |
parent | Merge pull request #978 from mc-server/VectorAssignmentOperator (diff) | |
download | cuberite-696a7bc52e9b029b627feee76eaf5e1239417033.tar cuberite-696a7bc52e9b029b627feee76eaf5e1239417033.tar.gz cuberite-696a7bc52e9b029b627feee76eaf5e1239417033.tar.bz2 cuberite-696a7bc52e9b029b627feee76eaf5e1239417033.tar.lz cuberite-696a7bc52e9b029b627feee76eaf5e1239417033.tar.xz cuberite-696a7bc52e9b029b627feee76eaf5e1239417033.tar.zst cuberite-696a7bc52e9b029b627feee76eaf5e1239417033.zip |
Diffstat (limited to '')
-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; } |