fix #2196 - crash when cycling stances while a unit dies
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user