diff --git a/OpenRA.Mods.Cnc/Traits/Minelayer.cs b/OpenRA.Mods.Cnc/Traits/Minelayer.cs index 03c682363a..4e183f87a8 100644 --- a/OpenRA.Mods.Cnc/Traits/Minelayer.cs +++ b/OpenRA.Mods.Cnc/Traits/Minelayer.cs @@ -218,7 +218,7 @@ namespace OpenRA.Mods.Cnc.Traits protected override void SelectionChanged(World world, IEnumerable selected) { minelayers.Clear(); - minelayers.AddRange(selected.Where(s => s.Info.HasTraitInfo())); + minelayers.AddRange(selected.Where(s => !s.IsDead && s.Info.HasTraitInfo())); if (!minelayers.Any()) world.CancelInputMode(); } diff --git a/OpenRA.Mods.Common/Orders/GuardOrderGenerator.cs b/OpenRA.Mods.Common/Orders/GuardOrderGenerator.cs index 82eadf7ac4..bcb7b978f7 100644 --- a/OpenRA.Mods.Common/Orders/GuardOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/GuardOrderGenerator.cs @@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Orders public override void SelectionChanged(World world, IEnumerable selected) { // Guarding doesn't work without AutoTarget, so require at least one unit in the selection to have it - subjects = selected.Where(s => s.Info.HasTraitInfo()); + subjects = selected.Where(s => !s.IsDead && s.Info.HasTraitInfo()); if (!subjects.Any(s => s.Info.HasTraitInfo())) world.CancelInputMode(); } diff --git a/OpenRA.Mods.Common/Traits/AttackMove.cs b/OpenRA.Mods.Common/Traits/AttackMove.cs index 09b26c4745..c464ebbfd4 100644 --- a/OpenRA.Mods.Common/Traits/AttackMove.cs +++ b/OpenRA.Mods.Common/Traits/AttackMove.cs @@ -123,7 +123,7 @@ namespace OpenRA.Mods.Common.Traits public override void SelectionChanged(World world, IEnumerable selected) { - subjects = selected.SelectMany(a => a.TraitsImplementing() + subjects = selected.Where(s => !s.IsDead).SelectMany(a => a.TraitsImplementing() .Select(am => new TraitPair(a, am))) .ToArray();