From 9895aee6f2350870e81bc645f6e9a68249d889df Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Wed, 20 May 2015 14:32:40 +0200 Subject: [PATCH] Disable unit selection by double-clicking for enemy units --- OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs index 07dbabeab8..26403447b6 100644 --- a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs +++ b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs @@ -109,10 +109,13 @@ namespace OpenRA.Widgets var unit = World.ScreenMap.ActorsAt(xy) .WithHighestSelectionPriority(); - var newSelection2 = SelectActorsInBox(World, worldRenderer.Viewport.TopLeft, worldRenderer.Viewport.BottomRight, - a => unit != null && a.Info.Name == unit.Info.Name && a.Owner == unit.Owner); + if (unit != null && unit.Owner == (World.RenderPlayer ?? World.LocalPlayer)) + { + var newSelection2 = SelectActorsInBox(World, worldRenderer.Viewport.TopLeft, worldRenderer.Viewport.BottomRight, + a => a.Owner == unit.Owner && a.Info.Name == unit.Info.Name); - World.Selection.Combine(World, newSelection2, true, false); + World.Selection.Combine(World, newSelection2, true, false); + } } else if (dragStart.HasValue) {