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:
@@ -21,10 +21,9 @@ namespace OpenRA.Network
|
||||
static Player FindPlayerByClient(this World world, Session.Client c)
|
||||
{
|
||||
/* todo: this is still a hack.
|
||||
* the cases we're trying to avoid are the extra players on the host's client -- Neutral, other MapPlayers,
|
||||
* bots,.. */
|
||||
* the cases we're trying to avoid are the extra players on the host's client -- Neutral, other MapPlayers,..*/
|
||||
return world.Players.FirstOrDefault(
|
||||
p => (p.ClientIndex == c.Index && p.PlayerRef.Playable && !p.IsBot));
|
||||
p => (p.ClientIndex == c.Index && p.PlayerRef.Playable));
|
||||
}
|
||||
|
||||
public static void ProcessOrder(OrderManager orderManager, World world, int clientId, Order order)
|
||||
|
||||
Reference in New Issue
Block a user