Ignore spectators when counting clients for the assignteams command

This commit is contained in:
Scott_NZ
2013-03-11 01:20:08 +13:00
parent 7af91f1747
commit bd292b56cf
2 changed files with 15 additions and 10 deletions

View File

@@ -163,12 +163,12 @@ namespace OpenRA.Mods.RA.Widgets.Logic
if (assignTeams != null)
{
assignTeams.IsVisible = () => Game.IsHost;
assignTeams.IsDisabled = () => gameStarting || orderManager.LobbyInfo.Clients.Count < 2
assignTeams.IsDisabled = () => gameStarting || orderManager.LobbyInfo.Clients.Count(c => c.Slot != null) < 2
|| orderManager.LocalClient == null || orderManager.LocalClient.IsReady;
assignTeams.OnMouseDown = _ =>
{
var options = Enumerable.Range(2, orderManager.LobbyInfo.Clients.Count.Clamp(2, 8) - 1).Select(d => new DropDownOption
var options = Enumerable.Range(2, orderManager.LobbyInfo.Clients.Count(c => c.Slot != null).Clamp(2, 8) - 1).Select(d => new DropDownOption
{
Title = "{0} Teams".F(d),
IsSelected = () => false,