Fixes #5394 Spawnpoint dropdown count

Fixes where the spawn point dropdown would show the same number of spawn
points as the number of players rather than the actual number of
available spawn points.
This commit is contained in:
Squiggles211
2014-05-23 02:07:06 -05:00
parent db08357e36
commit 7e2599c898

View File

@@ -422,7 +422,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
{
var dropdown = parent.Get<DropDownButtonWidget>("SPAWN");
dropdown.IsDisabled = () => s.LockSpawn || orderManager.LocalClient.IsReady;
dropdown.OnMouseDown = _ => ShowSpawnDropDown(dropdown, c, orderManager, Enumerable.Range(0, map.PlayerCount + 1)
dropdown.OnMouseDown = _ => ShowSpawnDropDown(dropdown, c, orderManager, Enumerable.Range(0, map.SpawnPoints.Count + 1)
.Except(orderManager.LobbyInfo.Clients.Where(client => client != c && client.SpawnPoint != 0).Select(client => client.SpawnPoint)));
dropdown.GetText = () => (c.SpawnPoint == 0) ? "-" : Convert.ToChar('A' - 1 + c.SpawnPoint).ToString();
}