diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-01-11 20:34:41 +0100 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-01-12 10:47:59 +0100 |
commit | 359e772dee0ef4595c8ad982f17e13725f255219 (patch) | |
tree | 4c784bee23613af41e0dda909b90c1c2fd7140a6 /src/Mobs/Monster.h | |
parent | Merge pull request #2848 from Nakkar/master (diff) | |
download | cuberite-359e772dee0ef4595c8ad982f17e13725f255219.tar cuberite-359e772dee0ef4595c8ad982f17e13725f255219.tar.gz cuberite-359e772dee0ef4595c8ad982f17e13725f255219.tar.bz2 cuberite-359e772dee0ef4595c8ad982f17e13725f255219.tar.lz cuberite-359e772dee0ef4595c8ad982f17e13725f255219.tar.xz cuberite-359e772dee0ef4595c8ad982f17e13725f255219.tar.zst cuberite-359e772dee0ef4595c8ad982f17e13725f255219.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Mobs/Monster.h | 2 |
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) |