Fix crash when selection contains destroyed actors.

This commit is contained in:
Paul Chote
2017-09-24 16:38:21 +01:00
committed by reaperrr
parent fa8ab19dfd
commit d8f53a9ccd

View File

@@ -124,7 +124,8 @@ namespace OpenRA.Mods.Common.Traits
{
expectedButton = button;
this.subjects = subjects.SelectMany(a => a.TraitsImplementing<AttackMove>()
this.subjects = subjects.Where(a => !a.IsDead)
.SelectMany(a => a.TraitsImplementing<AttackMove>()
.Select(am => new TraitPair<AttackMove>(a, am)))
.ToArray();
}