From 1ff11d41154464a568cc2a4cb1de794e81c8c870 Mon Sep 17 00:00:00 2001 From: rob-v Date: Wed, 3 May 2017 13:50:54 +0200 Subject: [PATCH] Number AI players --- OpenRA.Game/Player.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OpenRA.Game/Player.cs b/OpenRA.Game/Player.cs index 57df144da2..5e29730e79 100644 --- a/OpenRA.Game/Player.cs +++ b/OpenRA.Game/Player.cs @@ -105,7 +105,14 @@ namespace OpenRA { ClientIndex = client.Index; Color = client.Color; - PlayerName = client.Name; + if (client.Bot != null) + { + var botsOfSameType = world.LobbyInfo.Clients.Where(c => c.Bot == client.Bot).ToArray(); + PlayerName = botsOfSameType.Length == 1 ? client.Bot : "{0} {1}".F(client.Bot, botsOfSameType.IndexOf(client) + 1); + } + else + PlayerName = client.Name; + botType = client.Bot; Faction = ChooseFaction(world, client.Faction, !pr.LockFaction); DisplayFaction = ChooseDisplayFaction(world, client.Faction);