fix #2196 - crash when cycling stances while a unit dies

This commit is contained in:
Chris Forbes
2012-06-21 09:33:47 +12:00
parent 8eb4782a49
commit 5c4e49cc3f

View File

@@ -125,7 +125,7 @@ namespace OpenRA.Mods.RA.Widgets
bool PerformStanceCycle()
{
var actor = World.Selection.Actors
.Where(a => a.Owner == World.LocalPlayer)
.Where(a => a.Owner == World.LocalPlayer && !a.Destroyed)
.Select(a => Pair.New( a, a.TraitOrDefault<AutoTarget>() ))
.Where(a => a.Second != null).FirstOrDefault();
@@ -184,4 +184,4 @@ namespace OpenRA.Mods.RA.Widgets
return true;
}
}
}
}