Make bots first-class players.
- Bots have their own Clients, with unique ClientIDs - Hosts can set bot team/color in the lobby - Bots are kicked when switching to a smaller map without enough slots - Order validator assumes that only client 0 has permission to issue bot orders
This commit is contained in:
@@ -34,13 +34,13 @@ namespace OpenRA.Mods.RA
|
||||
foreach (var kv in w.LobbyInfo.Slots)
|
||||
{
|
||||
var client = w.LobbyInfo.ClientInSlot(kv.Key);
|
||||
if (client == null && kv.Value.Bot == null)
|
||||
if (client == null)
|
||||
continue;
|
||||
|
||||
var player = new Player(w, client, kv.Value, w.Map.Players[kv.Value.PlayerReference]);
|
||||
w.AddPlayer(player);
|
||||
|
||||
if (client != null && client.Index == Game.LocalClientId)
|
||||
if (client.Index == Game.LocalClientId)
|
||||
w.SetLocalPlayer(player.InternalName);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user