From a1f876b13cdd2f86d5f633bac120c7a68402749f Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 9 Nov 2013 16:39:18 +1300 Subject: [PATCH] Use selection priority in double-click selection logic. Fixes #4053. --- OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs index b68ea43e1b..6e4c2c2534 100644 --- a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs +++ b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs @@ -92,7 +92,10 @@ namespace OpenRA.Widgets { if (multiClick) { - var unit = World.ScreenMap.ActorsAt(xy).FirstOrDefault(); + var unit = World.ScreenMap.ActorsAt(xy) + .OrderByDescending(a => a.Info.SelectionPriority()) + .FirstOrDefault(); + var newSelection2 = SelectActorsInBox(World, worldRenderer.Viewport.TopLeft, worldRenderer.Viewport.BottomRight, a => unit != null && a.Info.Name == unit.Info.Name && a.Owner == unit.Owner);