From 01de84e9fca196216656bb2857f510608795e542 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 7 Jul 2013 11:14:41 +1200 Subject: [PATCH] Ensure valid targets in Selectable. --- OpenRA.Game/Traits/Selectable.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/Traits/Selectable.cs b/OpenRA.Game/Traits/Selectable.cs index b2a4ffe058..2a8f95f485 100644 --- a/OpenRA.Game/Traits/Selectable.cs +++ b/OpenRA.Game/Traits/Selectable.cs @@ -161,7 +161,7 @@ namespace OpenRA.Traits var c = Color.Green; var wlr = Game.Renderer.WorldLineRenderer; - foreach (var stp in targets.Select(p => wr.ScreenPxPosition(p.CenterPosition))) + foreach (var stp in targets.Where(t => t.IsValid).Select(p => wr.ScreenPxPosition(p.CenterPosition))) { wlr.DrawLine(stp + new float2(-1, -1), stp + new float2(-1, 1), c, c); wlr.DrawLine(stp + new float2(-1, 1), stp + new float2(1, 1), c, c);