From ae394f937b9a39f2254f8698828e98440966da99 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 31 Dec 2017 17:34:59 +0000 Subject: [PATCH] Fix the color validator overriding spectator colors. --- OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs b/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs index db62f70752..6364233752 100644 --- a/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs +++ b/OpenRA.Mods.Common/ServerTraits/LobbyCommands.cs @@ -399,7 +399,7 @@ namespace OpenRA.Mods.Common.Server // Validate if color is allowed and get an alternative if it isn't foreach (var c in server.LobbyInfo.Clients) - if (c.Slot == null || (c.Slot != null && !server.LobbyInfo.Slots[c.Slot].LockColor)) + if (c.Slot != null && !server.LobbyInfo.Slots[c.Slot].LockColor) c.Color = c.PreferredColor = SanitizePlayerColor(server, c.Color, c.Index, conn); server.SyncLobbyInfo(); @@ -867,7 +867,7 @@ namespace OpenRA.Mods.Common.Server var client = server.GetClient(conn); // Validate whether color is allowed and get an alternative if it isn't - if (client.Slot == null || !server.LobbyInfo.Slots[client.Slot].LockColor) + if (client.Slot != null && !server.LobbyInfo.Slots[client.Slot].LockColor) client.Color = SanitizePlayerColor(server, client.Color, client.Index); // Report any custom map details