Fix CA1851

This commit is contained in:
RoosterDragon
2023-07-13 20:08:36 +01:00
committed by abcdefg30
parent 88f830a9e5
commit 3275875ae5
63 changed files with 349 additions and 267 deletions

View File

@@ -196,8 +196,8 @@ namespace OpenRA.Mods.Common.Activities
// Update ranges. Exclude paused armaments except when ALL weapons are paused
// (e.g. out of ammo), in which case use the paused, valid weapon with highest range.
var activeArmaments = armaments.Where(x => !x.IsTraitPaused);
if (activeArmaments.Any())
var activeArmaments = armaments.Where(x => !x.IsTraitPaused).ToList();
if (activeArmaments.Count != 0)
{
minRange = activeArmaments.Max(a => a.Weapon.MinRange);
maxRange = activeArmaments.Min(a => a.MaxRange());