Properly account for disabled Armaments in various places

These places didn't care if an Armament was disabled, which could lead to unexpected behavior.
This commit is contained in:
reaperrr
2017-08-19 14:01:48 +02:00
committed by Paul Chote
parent 951ee2210c
commit c75e64a952
3 changed files with 7 additions and 1 deletions

View File

@@ -59,7 +59,7 @@ namespace OpenRA.Mods.Common.Activities
return NextActivity;
// TODO: This should fire each weapon at its maximum range
if (attackPlane != null && target.IsInRange(self.CenterPosition, attackPlane.Armaments.Select(a => a.Weapon.MinRange).Min()))
if (attackPlane != null && target.IsInRange(self.CenterPosition, attackPlane.Armaments.Where(Exts.IsTraitEnabled).Select(a => a.Weapon.MinRange).Min()))
ChildActivity = ActivityUtils.SequenceActivities(new FlyTimed(ticksUntilTurn, self), new Fly(self, target), new FlyTimed(ticksUntilTurn, self));
else
ChildActivity = ActivityUtils.SequenceActivities(new Fly(self, target), new FlyTimed(ticksUntilTurn, self));