diff options
author | megamage <none@none> | 2009-04-12 16:32:03 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-12 16:32:03 -0500 |
commit | 74977d73f3758b866d90ace7f9cf075c2be540fc (patch) | |
tree | 2f0eecad0f439787d4a78cfb19478ca6eb32b77d | |
parent | a8a0a03b1b5eb17a841baba14f58206685d375c9 (diff) |
*Do not allow chase/follow self.
--HG--
branch : trunk
-rw-r--r-- | src/game/MotionMaster.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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); |