From d8f53a9ccd7b45cb825f53b48664755039159769 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 24 Sep 2017 16:38:21 +0100 Subject: [PATCH] Fix crash when selection contains destroyed actors. --- OpenRA.Mods.Common/Traits/AttackMove.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/AttackMove.cs b/OpenRA.Mods.Common/Traits/AttackMove.cs index ad8dac398f..69a8e453cc 100644 --- a/OpenRA.Mods.Common/Traits/AttackMove.cs +++ b/OpenRA.Mods.Common/Traits/AttackMove.cs @@ -124,7 +124,8 @@ namespace OpenRA.Mods.Common.Traits { expectedButton = button; - this.subjects = subjects.SelectMany(a => a.TraitsImplementing() + this.subjects = subjects.Where(a => !a.IsDead) + .SelectMany(a => a.TraitsImplementing() .Select(am => new TraitPair(a, am))) .ToArray(); }