From a639d9587d1ca8715cc3f85f33020e484859ce9e Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 13 Jan 2016 23:45:25 +0000 Subject: [PATCH] Disable slot admin dropdown when empty. --- OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs index 300f92c001..20061830f4 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs @@ -190,8 +190,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic var slotsButton = lobby.GetOrNull("SLOTS_DROPDOWNBUTTON"); if (slotsButton != null) { - slotsButton.IsDisabled = () => configurationDisabled() || panel != PanelType.Players || - Map.RuleStatus != MapRuleStatus.Cached || !orderManager.LobbyInfo.Slots.Values.Any(s => s.AllowBots || !s.LockTeam); + slotsButton.IsDisabled = () => configurationDisabled() || panel != PanelType.Players || Map.RuleStatus != MapRuleStatus.Cached || + (orderManager.LobbyInfo.Slots.Values.All(s => !s.AllowBots) && + orderManager.LobbyInfo.Slots.Count(s => !s.Value.LockTeam && orderManager.LobbyInfo.ClientInSlot(s.Key) != null) == 0); var botNames = modRules.Actors["player"].TraitInfos().Select(t => t.Name); slotsButton.OnMouseDown = _ =>