aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormaximius <none@none>2009-10-24 14:53:03 -0700
committermaximius <none@none>2009-10-24 14:53:03 -0700
commit19ea9b8de4ad24a96dec925fac0eccb5b1897e7f (patch)
tree4881a4a241b9909edadc43a205ba7cd1b65f385c /src
parent97cfa7782aba72949ec289d1e50d67d088909eb9 (diff)
*Disregard visibility state when evaluating a potential target.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Creature.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index edfa4d25c0a..82afa402ff7 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -2188,7 +2188,10 @@ bool Creature::_IsTargetAcceptable(const Unit *target) const
assert(target);
// if the target cannot be attacked, the target is not acceptable
- if (!canAttack(target, true))
+ if (IsFriendlyTo(target)
+ || !target->isAttackableByAOE()
+ || target->hasUnitState(UNIT_STAT_DIED)
+ || (m_vehicle && (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(target))))
return false;
const Unit *myVictim = getAttackerForHelper();
@@ -2199,7 +2202,7 @@ bool Creature::_IsTargetAcceptable(const Unit *target) const
return true;
// if the target's victim is friendly, and the target is neutral, the target is acceptable
- if (targetVictim && IsFriendlyTo(targetVictim))// && !IsFriendlyTo(target)) <- already handled in !canAttack(target, true)
+ if (targetVictim && IsFriendlyTo(targetVictim))
return true;
// if the target's victim is not friendly, or the target is friendly, the target is not acceptable