diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-08-22 20:35:56 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-08-22 20:35:56 +0200 |
commit | e254a76884d7252e6c645eacbc355c894a6d62b4 (patch) | |
tree | 13e27f8fc67772af07376c79830107a1037bc8a7 /src/Mobs | |
parent | Cast UINT to WORD to appease warning (diff) | |
download | cuberite-e254a76884d7252e6c645eacbc355c894a6d62b4.tar cuberite-e254a76884d7252e6c645eacbc355c894a6d62b4.tar.gz cuberite-e254a76884d7252e6c645eacbc355c894a6d62b4.tar.bz2 cuberite-e254a76884d7252e6c645eacbc355c894a6d62b4.tar.lz cuberite-e254a76884d7252e6c645eacbc355c894a6d62b4.tar.xz cuberite-e254a76884d7252e6c645eacbc355c894a6d62b4.tar.zst cuberite-e254a76884d7252e6c645eacbc355c894a6d62b4.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Mobs/AggressiveMonster.cpp | 18 | ||||
-rw-r--r-- | src/Mobs/AggressiveMonster.h | 5 |
2 files changed, 0 insertions, 23 deletions
diff --git a/src/Mobs/AggressiveMonster.cpp b/src/Mobs/AggressiveMonster.cpp index 7fde1e56b..65bda2dff 100644 --- a/src/Mobs/AggressiveMonster.cpp +++ b/src/Mobs/AggressiveMonster.cpp @@ -104,21 +104,3 @@ void cAggressiveMonster::Attack(std::chrono::milliseconds a_Dt) m_AttackInterval = 0.0; m_Target->TakeDamage(dtMobAttack, this, m_AttackDamage, 0); } - - - - -bool cAggressiveMonster::IsMovingToTargetPosition() -{ - // Difference between destination x and target x is negligible (to 10^-12 precision) - if (fabsf(static_cast<float>(m_FinalDestination.x) - static_cast<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(static_cast<float>(m_FinalDestination.z) - static_cast<float>(m_Target->GetPosZ())) > std::numeric_limits<float>::epsilon()) - { - return false; - } - return true; -} diff --git a/src/Mobs/AggressiveMonster.h b/src/Mobs/AggressiveMonster.h index f64c1103f..f46a5c1ef 100644 --- a/src/Mobs/AggressiveMonster.h +++ b/src/Mobs/AggressiveMonster.h @@ -21,11 +21,6 @@ public: virtual void EventSeePlayer(cEntity *) override; virtual void Attack(std::chrono::milliseconds a_Dt); - -protected: - /** Whether this mob's destination is the same as its target's position. */ - bool IsMovingToTargetPosition(); - } ; |