Fix the command bar selecting dead units

and crashing while doing a trait lookup on them.
This commit is contained in:
Matthias Mailänder
2020-10-10 20:48:47 +02:00
committed by abcdefg30
parent 8a7020b4ef
commit 0d64fa549b
3 changed files with 3 additions and 3 deletions

View File

@@ -218,7 +218,7 @@ namespace OpenRA.Mods.Cnc.Traits
protected override void SelectionChanged(World world, IEnumerable<Actor> selected)
{
minelayers.Clear();
minelayers.AddRange(selected.Where(s => s.Info.HasTraitInfo<MinelayerInfo>()));
minelayers.AddRange(selected.Where(s => !s.IsDead && s.Info.HasTraitInfo<MinelayerInfo>()));
if (!minelayers.Any())
world.CancelInputMode();
}