Avoid a crash if subjects is empty.

This can happen in the rare instance that the last
actor in the selection is killed in the same tick
that the OG is activated, and GetCursor is called
before the next tick cancels the OG.
This commit is contained in:
Paul Chote
2018-11-19 22:15:58 +00:00
committed by Oliver Brakmann
parent 3b6024c086
commit 1af9efe246

View File

@@ -175,7 +175,7 @@ namespace OpenRA.Mods.Common.Traits
{
var prefix = mi.Modifiers.HasModifier(Modifiers.Ctrl) ? "assaultmove" : "attackmove";
if (world.Map.Contains(cell))
if (world.Map.Contains(cell) && subjects.Any())
{
var explored = subjects.First().Actor.Owner.Shroud.IsExplored(cell);
var blocked = !explored && subjects.Any(a => !a.Trait.Info.MoveIntoShroud);