*Disregard visibility state when evaluating a potential target.

--HG--
branch : trunk
This commit is contained in:
maximius
2009-10-24 14:53:03 -07:00
parent 97cfa7782a
commit 19ea9b8de4

View File

@@ -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