From c0ece00c4b9b34cb376369bf19d55a2f5fdbe7df Mon Sep 17 00:00:00 2001 From: abc013 Date: Sat, 22 Feb 2020 23:06:46 +0100 Subject: [PATCH] Prevent production cycling when producing actor does not occupy space --- .../Logic/Ingame/Hotkeys/CycleProductionActorsHotkeyLogic.cs | 2 +- OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Ingame/Hotkeys/CycleProductionActorsHotkeyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Ingame/Hotkeys/CycleProductionActorsHotkeyLogic.cs index 0140a7f37d..82bb7fded7 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Ingame/Hotkeys/CycleProductionActorsHotkeyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Ingame/Hotkeys/CycleProductionActorsHotkeyLogic.cs @@ -46,7 +46,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic.Ingame var player = world.RenderPlayer ?? world.LocalPlayer; var facilities = world.ActorsHavingTrait() - .Where(a => a.Owner == player && !a.Info.HasTraitInfo() + .Where(a => a.Owner == player && a.OccupiesSpace != null && !a.Info.HasTraitInfo() && a.TraitsImplementing().Any(t => !t.IsTraitDisabled)) .OrderBy(f => f.TraitsImplementing().First(t => !t.IsTraitDisabled).Info.Produces.First()) .ToList(); diff --git a/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs b/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs index 53b3a8438b..495a5dd1b2 100644 --- a/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ProductionPaletteWidget.cs @@ -389,7 +389,7 @@ namespace OpenRA.Mods.Common.Widgets var facility = CurrentQueue.MostLikelyProducer().Actor; - if (facility == null) + if (facility == null || facility.OccupiesSpace == null) return true; if (selection.Actors.Count() == 1 && selection.Contains(facility))