summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Monster.h
diff options
context:
space:
mode:
authorLogicParrot <LogicParrot@users.noreply.github.com>2016-01-12 11:13:36 +0100
committerLogicParrot <LogicParrot@users.noreply.github.com>2016-01-12 11:13:36 +0100
commite2a053263f4798f879392756bb056eabf0ade3a4 (patch)
tree5d543baa8842fe74c4ed66984860be483d28c627 /src/Mobs/Monster.h
parentMerge pull request #2853 from cuberite/DetailedBlockAreaLogging (diff)
parentTamed wolf assists owner (attack / defence) (diff)
downloadcuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar
cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar.gz
cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar.bz2
cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar.lz
cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar.xz
cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.tar.zst
cuberite-e2a053263f4798f879392756bb056eabf0ade3a4.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Monster.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Mobs/Monster.h b/src/Mobs/Monster.h
index cc830a058..43ea91471 100644
--- a/src/Mobs/Monster.h
+++ b/src/Mobs/Monster.h
@@ -188,7 +188,7 @@ protected:
bool ReachedFinalDestination(void) { return ((m_FinalDestination - GetPosition()).SqrLength() < WAYPOINT_RADIUS * WAYPOINT_RADIUS); }
/** Returns whether or not the target is close enough for attack. */
- bool TargetIsInRange(void) { return ((m_FinalDestination - GetPosition()).SqrLength() < (m_AttackRange * m_AttackRange)); }
+ 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)