aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2009-04-12 16:32:03 -0500
committermegamage <none@none>2009-04-12 16:32:03 -0500
commit74977d73f3758b866d90ace7f9cf075c2be540fc (patch)
tree2f0eecad0f439787d4a78cfb19478ca6eb32b77d
parenta8a0a03b1b5eb17a841baba14f58206685d375c9 (diff)
*Do not allow chase/follow self.
--HG-- branch : trunk
-rw-r--r--src/game/MotionMaster.cpp4
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);