aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-08-22 21:10:15 -0500
committermegamage <none@none>2009-08-22 21:10:15 -0500
commit336fd3f4edb6690aa0ed6ccc3bb3e2350eda9a61 (patch)
tree9dd9cb824aa10724aa830974ce1cc67a84b24301 /src
parentb524ef4abe727f8a15cafbadef9a7cbfce0fc8f4 (diff)
*Do not allow creature to enterevademode when it is on vehicle.
*Do not allow unit to attack its vehicle. --HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Unit.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 634bbf12bf6..1cf62750315 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -10524,6 +10524,9 @@ bool Unit::canAttack(Unit const* target, bool force) const
if(target->GetVisibility() == VISIBILITY_GROUP_STEALTH && !canDetectStealthOf(target, GetDistance(target)))
return false;
+ if(target == m_Vehicle)
+ return false;
+
return true;
}
@@ -11247,6 +11250,9 @@ Unit* Creature::SelectVictim()
return NULL;
}
+ if(m_Vehicle)
+ return NULL;
+
// search nearby enemy before enter evade mode
if(HasReactState(REACT_AGGRESSIVE))
if(target = SelectNearestTarget())