Merge pull request #8731 from deniz1a/simplify-lobby-logic

Simplifies Start button logic in lobby
This commit is contained in:
abcdefg30
2015-08-24 21:27:05 +02:00
4 changed files with 4 additions and 13 deletions

View File

@@ -297,15 +297,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
orderManager.LobbyInfo.Slots.Any(sl => sl.Value.Required && orderManager.LobbyInfo.ClientInSlot(sl.Key) == null);
startGameButton.OnClick = () =>
{
Func<KeyValuePair<string, Session.Slot>, bool> notReady = sl =>
{
var cl = orderManager.LobbyInfo.ClientInSlot(sl.Key);
// Bots and admins don't count
return cl != null && !cl.IsAdmin && cl.Bot == null && !cl.IsReady;
};
if (orderManager.LobbyInfo.Slots.Any(notReady))
// Bots and admins don't count
if (orderManager.LobbyInfo.Clients.Any(c => c.Slot != null && !c.IsAdmin && c.Bot == null && !c.IsReady))
panel = PanelType.ForceStart;
else
startGame();