From 1af9efe24678873443e8ef7d3b735f7e06389381 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Mon, 19 Nov 2018 22:15:58 +0000 Subject: [PATCH] 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. --- OpenRA.Mods.Common/Traits/AttackMove.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/Traits/AttackMove.cs b/OpenRA.Mods.Common/Traits/AttackMove.cs index 86d5c2b389..5b40cae28b 100644 --- a/OpenRA.Mods.Common/Traits/AttackMove.cs +++ b/OpenRA.Mods.Common/Traits/AttackMove.cs @@ -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);