Make AI StateBase.CanAttackTarget only return true on valid armaments that are also enabled

This commit is contained in:
reaperrr
2017-12-02 04:20:49 +01:00
committed by Paul Chote
parent e6835cef6e
commit 382c0b5f1d

View File

@@ -70,8 +70,13 @@ namespace OpenRA.Mods.Common.AI
var arms = a.TraitsImplementing<Armament>();
foreach (var arm in arms)
{
if (arm.IsTraitDisabled)
continue;
if (arm.Weapon.IsValidTarget(targetTypes))
return true;
}
return false;
}