From 74977d73f3758b866d90ace7f9cf075c2be540fc Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 12 Apr 2009 16:32:03 -0500 Subject: *Do not allow chase/follow self. --HG-- branch : trunk --- src/game/MotionMaster.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/game/MotionMaster.cpp b/src/game/MotionMaster.cpp index 170a9b52211..9beecf9c5cf 100644 --- a/src/game/MotionMaster.cpp +++ b/src/game/MotionMaster.cpp @@ -245,7 +245,7 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle) { // ignore movement request if target not exist - if(!target) + if(!target || target == i_owner) return; i_owner->clearUnitState(UNIT_STAT_FOLLOW); @@ -271,7 +271,7 @@ void MotionMaster::MoveFollow(Unit* target, float dist, float angle) { // ignore movement request if target not exist - if(!target) + if(!target || target == i_owner) return; i_owner->addUnitState(UNIT_STAT_FOLLOW); -- cgit v1.2.3