Disable unit selection by double-clicking for enemy units

This commit is contained in:
Oliver Brakmann
2015-05-20 14:32:40 +02:00
parent 5db63ba7aa
commit 9895aee6f2

View File

@@ -109,11 +109,14 @@ namespace OpenRA.Widgets
var unit = World.ScreenMap.ActorsAt(xy)
.WithHighestSelectionPriority();
if (unit != null && unit.Owner == (World.RenderPlayer ?? World.LocalPlayer))
{
var newSelection2 = SelectActorsInBox(World, worldRenderer.Viewport.TopLeft, worldRenderer.Viewport.BottomRight,
a => unit != null && a.Info.Name == unit.Info.Name && a.Owner == unit.Owner);
a => a.Owner == unit.Owner && a.Info.Name == unit.Info.Name);
World.Selection.Combine(World, newSelection2, true, false);
}
}
else if (dragStart.HasValue)
{
var newSelection = SelectActorsInBoxWithDeadzone(World, dragStart.Value, xy, _ => true);