From 336fd3f4edb6690aa0ed6ccc3bb3e2350eda9a61 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 22 Aug 2009 21:10:15 -0500 Subject: [PATCH] *Do not allow creature to enterevademode when it is on vehicle. *Do not allow unit to attack its vehicle. --HG-- branch : trunk --- src/game/Unit.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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())