From 19ea9b8de4ad24a96dec925fac0eccb5b1897e7f Mon Sep 17 00:00:00 2001 From: maximius Date: Sat, 24 Oct 2009 14:53:03 -0700 Subject: *Disregard visibility state when evaluating a potential target. --HG-- branch : trunk --- src/game/Creature.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit v1.2.3