diff options
author | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-01-12 11:13:36 +0100 |
---|---|---|
committer | LogicParrot <LogicParrot@users.noreply.github.com> | 2016-01-12 11:13:36 +0100 |
commit | e2a053263f4798f879392756bb056eabf0ade3a4 (patch) | |
tree | 5d543baa8842fe74c4ed66984860be483d28c627 /src/Mobs/Monster.h | |
parent | Merge pull request #2853 from cuberite/DetailedBlockAreaLogging (diff) | |
parent | Tamed wolf assists owner (attack / defence) (diff) | |
download | cuberite-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 'src/Mobs/Monster.h')
-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) |