Disable color validation for locked colors.

This commit is contained in:
Paul Chote
2016-01-13 23:06:40 +00:00
parent 8a755e673c
commit 80b5311082

View File

@@ -136,8 +136,11 @@ namespace OpenRA.Mods.Common.Server
client.Slot = s;
S.SyncClientToPlayerReference(client, server.MapPlayers.Players[s]);
if (!slot.LockColor)
{
var validatedColor = ColorValidator.ValidatePlayerColorAndGetAlternative(server, client.Color, client.Index, conn);
client.PreferredColor = client.Color = validatedColor;
}
server.SyncLobbyClients();
CheckAutoStart(server);
@@ -368,6 +371,7 @@ namespace OpenRA.Mods.Common.Server
foreach (var c in server.LobbyInfo.Clients)
{
// Validate if color is allowed and get an alternative it isn't
if (c.Slot == null || (c.Slot != null && !server.LobbyInfo.Slots[c.Slot].LockColor))
c.Color = c.PreferredColor = ColorValidator.ValidatePlayerColorAndGetAlternative(server, c.Color, c.Index, conn);
}