From 1d623299697c342f62c545a0a26f071e3420f954 Mon Sep 17 00:00:00 2001 From: Igor Popov Date: Sun, 14 Oct 2012 14:28:13 +0400 Subject: [PATCH] fix #2425; Bots should be removed when switching to a map which doesn't allow them --- OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs b/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs index 41279e4b95..ad9cfbb15d 100644 --- a/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs +++ b/OpenRA.Mods.RA/ServerTraits/LobbyCommands.cs @@ -278,7 +278,12 @@ namespace OpenRA.Mods.RA.Server c.State = Session.ClientState.NotReady; c.Slot = i < slots.Length ? slots[i++] : null; if (c.Slot != null) + { + // Remove Bot from slot if slot forbids bots + if (c.Bot != null && !server.Map.Players[c.Slot].AllowBots) + server.lobbyInfo.Clients.Remove(c); S.SyncClientToPlayerReference(c, server.Map.Players[c.Slot]); + } else if (c.Bot != null) server.lobbyInfo.Clients.Remove(c); }