Allow weapons with no damage warheads to be fired

This commit is contained in:
dnqbob
2022-10-06 18:15:48 +08:00
committed by Matthias Mailänder
parent 08de346e31
commit 583d85cc2e

View File

@@ -14,7 +14,6 @@ using System.Collections.Generic;
using System.Linq;
using OpenRA.Activities;
using OpenRA.Mods.Common.Activities;
using OpenRA.Mods.Common.Warheads;
using OpenRA.Primitives;
using OpenRA.Traits;
@@ -177,8 +176,7 @@ namespace OpenRA.Mods.Common.Traits
if (IsTraitDisabled)
yield break;
var armament = Armaments.FirstOrDefault(a => a.Weapon.Warheads.Any(w => (w is DamageWarhead)));
if (armament == null)
if (!Armaments.Any())
yield break;
yield return new AttackOrderTargeter(this, 6);