diff --git a/OpenRA.Mods.Common/Widgets/WorldCommandWidget.cs b/OpenRA.Mods.Common/Widgets/WorldCommandWidget.cs index 0f5486baaa..0c67047835 100644 --- a/OpenRA.Mods.Common/Widgets/WorldCommandWidget.cs +++ b/OpenRA.Mods.Common/Widgets/WorldCommandWidget.cs @@ -15,6 +15,7 @@ using OpenRA.Graphics; using OpenRA.Mods.Common.Traits; using OpenRA.Orders; using OpenRA.Primitives; +using OpenRA.Traits; using OpenRA.Widgets; namespace OpenRA.Mods.Common.Widgets @@ -191,8 +192,20 @@ namespace OpenRA.Mods.Common.Widgets .Select(b => b.Actor) .ToList(); + // If no BaseBuilding exist pick the first selectable Building. if (!bases.Any()) - return true; + { + var building = world.ActorsWithTrait() + .Select(b => b.Actor) + .FirstOrDefault(a => a.Owner == world.LocalPlayer && a.HasTrait()); + + // No buildings left + if (building == null) + return true; + + world.Selection.Combine(world, new Actor[] { building }, false, true); + return ToSelection(); + } var next = bases .SkipWhile(b => !world.Selection.Actors.Contains(b))