Prevent attack move crashing if selected actors die.

- Cancel attack move if all actors die.
- Command bar no longer shows available actions from any dead units.
This commit is contained in:
RoosterDragon
2018-03-22 20:12:45 +00:00
committed by reaperrr
parent 7be71eb381
commit c9b19ffe52
2 changed files with 7 additions and 1 deletions

View File

@@ -267,7 +267,7 @@ namespace OpenRA.Mods.Common.Widgets
return;
selectedActors = world.Selection.Actors
.Where(a => a.Owner == world.LocalPlayer && a.IsInWorld)
.Where(a => a.Owner == world.LocalPlayer && a.IsInWorld && !a.IsDead)
.ToArray();
attackMoveDisabled = !selectedActors.Any(a => a.Info.HasTraitInfo<AttackMoveInfo>() && a.Info.HasTraitInfo<AutoTargetInfo>());