diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs index 8259af78c0..0ccd12eddd 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs @@ -144,8 +144,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic colorPreview = lobby.Get("COLOR_MANAGER"); colorPreview.Color = Game.Settings.Player.Color; - foreach (var c in modRules.Actors["world"].Traits.WithInterface().Where(c => c.Selectable)) - countries.Add(c.Race, new LobbyCountry { Name = c.Name, Side = c.Side, Description = c.Description }); + foreach (var c in modRules.Actors["world"].Traits.WithInterface()) + countries.Add(c.Race, new LobbyCountry { Selectable = c.Selectable, Name = c.Name, Side = c.Side, Description = c.Description }); var gameStarting = false; Func configurationDisabled = () => !Game.IsHost || gameStarting || @@ -829,6 +829,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic public class LobbyCountry { + public bool Selectable; public string Name; public string Description; public string Side; diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs index afb0ba75f4..08e244ea0a 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyUtils.cs @@ -121,7 +121,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic return item; }; - var options = countries.GroupBy(c => c.Value.Side).ToDictionary(g => g.Key ?? "", g => g.Select(c => c.Key)); + var options = countries.Where(c => c.Value.Selectable).GroupBy(c => c.Value.Side) + .ToDictionary(g => g.Key ?? "", g => g.Select(c => c.Key)); dropdown.ShowDropDown("RACE_DROPDOWN_TEMPLATE", 150, options, setupItem); }