From 00dc6f1633bb6e08e82c637e67282035df6d00ba Mon Sep 17 00:00:00 2001 From: Oliver Brakmann Date: Sat, 27 Sep 2014 01:41:40 +0200 Subject: [PATCH] Do not validate the color of players which have the LockColor flag set Fixes #6572 --- OpenRA.Mods.Common/ServerTraits/ColorValidator.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/ServerTraits/ColorValidator.cs b/OpenRA.Mods.Common/ServerTraits/ColorValidator.cs index 7e4ac0be24..026bd67f47 100644 --- a/OpenRA.Mods.Common/ServerTraits/ColorValidator.cs +++ b/OpenRA.Mods.Common/ServerTraits/ColorValidator.cs @@ -203,9 +203,11 @@ namespace OpenRA.Mods.Common.Server public void ClientJoined(S server, Connection conn) { var client = server.GetClient(conn); + var slot = server.LobbyInfo.Clients[client.Index].Slot; - // Validate if color is allowed and get an alternative if it isn't - client.Color = ColorValidator.ValidatePlayerColorAndGetAlternative(server, client.Color, client.Index); + // Validate whether color is allowed and get an alternative if it isn't + if (!server.LobbyInfo.Slots[slot].LockColor) + client.Color = ColorValidator.ValidatePlayerColorAndGetAlternative(server, client.Color, client.Index); } #endregion