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

@@ -165,6 +165,12 @@ namespace OpenRA.Mods.Common.Traits
}
}
public override void Tick(World world)
{
if (subjects.All(s => s.Actor.IsDead))
world.CancelInputMode();
}
public override string GetCursor(World world, CPos cell, int2 worldPixel, MouseInput mi)
{
var prefix = mi.Modifiers.HasModifier(Modifiers.Ctrl) ? "assaultmove" : "attackmove";