summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2017-05-28 20:56:17 +0200
committerGitHub <noreply@github.com>2017-05-28 20:56:17 +0200
commit0551d78dffd5d377de382e34d9f6c77773c68202 (patch)
tree1e0629ff3b9d602c2c058b2bcf07fd8c93a30974 /src/Mobs/Monster.h
parentMinor cBrewingRecipes cleanup (#3731) (diff)
downloadcuberite-0551d78dffd5d377de382e34d9f6c77773c68202.tar
cuberite-0551d78dffd5d377de382e34d9f6c77773c68202.tar.gz
cuberite-0551d78dffd5d377de382e34d9f6c77773c68202.tar.bz2
cuberite-0551d78dffd5d377de382e34d9f6c77773c68202.tar.lz
cuberite-0551d78dffd5d377de382e34d9f6c77773c68202.tar.xz
cuberite-0551d78dffd5d377de382e34d9f6c77773c68202.tar.zst
cuberite-0551d78dffd5d377de382e34d9f6c77773c68202.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Monster.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index a4d256578..6dac2c1fb 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -208,10 +208,10 @@ protected:
/** Returns whether or not the target is close enough for attack. */
bool TargetIsInRange(void) { ASSERT(m_Target != nullptr); return ((m_Target->GetPosition() - GetPosition()).SqrLength() < (m_AttackRange * m_AttackRange)); }
- /** Returns if a monster can reach a given height by jumping. */
- inline bool DoesPosYRequireJump(int a_PosY)
+ /** Returns whether the monster needs to jump to reach a given height. */
+ inline bool DoesPosYRequireJump(double a_PosY)
{
- return ((a_PosY > POSY_TOINT));
+ return (a_PosY > GetPosY() + 0.8); // Assume that differences up to 0.8 blocks can be walked instead of jumped
}
/** Move in a straight line to the next waypoint in the path, will jump if needed. */