From dc3dc7df735e9c584d1204e5a2fb543ff5f1c4f9 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Tue, 18 May 2021 22:32:26 +0100 Subject: [PATCH] Fix map-player bots not working on dedicated servers. The host is almost never going to be client index 0 on public dedicated servers. Set to the actual host client ID instead. --- OpenRA.Game/Player.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/Player.cs b/OpenRA.Game/Player.cs index 5d05338a39..10c4e93c42 100644 --- a/OpenRA.Game/Player.cs +++ b/OpenRA.Game/Player.cs @@ -178,7 +178,7 @@ namespace OpenRA else { // Map player - ClientIndex = 0; // Owned by the host (TODO: fix this) + ClientIndex = world.LobbyInfo.Clients.FirstOrDefault(c => c.IsAdmin)?.Index ?? 0; // Owned by the host (TODO: fix this) Color = pr.Color; PlayerName = pr.Name; NonCombatant = pr.NonCombatant;