only add bots when the map allows it

fixes #5110
This commit is contained in:
Matthias Mailänder
2014-04-18 17:59:45 +02:00
parent 657141bce0
commit ab3dc92554
2 changed files with 13 additions and 5 deletions

View File

@@ -76,6 +76,11 @@ namespace OpenRA.Network
return Slots.FirstOrDefault(s => !s.Value.Closed && ClientInSlot(s.Key) == null).Key;
}
public string FirstEmptyBotSlot()
{
return Slots.FirstOrDefault(s => !s.Value.Closed && ClientInSlot(s.Key) == null && s.Value.AllowBots).Key;
}
public bool IsSinglePlayer
{
get { return Clients.Count(c => c.Bot == null) == 1; }