From 359e772dee0ef4595c8ad982f17e13725f255219 Mon Sep 17 00:00:00 2001 From: LogicParrot Date: Mon, 11 Jan 2016 21:34:41 +0200 Subject: Tamed wolf assists owner (attack / defence) --- src/Mobs/Monster.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Mobs/Monster.h') 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) -- cgit v1.2.3