Skip to content

Commit

Permalink
Make AI StateBase.CanAttackTarget only return true on valid armaments…
Browse files Browse the repository at this point in the history
… that are also enabled
  • Loading branch information
reaperrr committed Dec 2, 2017
1 parent 8e984b2 commit 3caab76
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions OpenRA.Mods.Common/AI/States/StateBase.cs
Expand Up @@ -70,8 +70,13 @@ protected static bool CanAttackTarget(Actor a, Actor target)

var arms = a.TraitsImplementing<Armament>();
foreach (var arm in arms)
{
if (arm.IsTraitDisabled)
continue;

if (arm.Weapon.IsValidTarget(targetTypes))
return true;
}

return false;
}
Expand Down

0 comments on commit 3caab76

Please sign in to comment.