Merge pull request #10507 from pchote/fix-locked-color-validation
Disable color validation for locked colors.
This commit is contained in:
@@ -135,8 +135,11 @@ namespace OpenRA.Mods.Common.Server
|
|||||||
client.Slot = s;
|
client.Slot = s;
|
||||||
S.SyncClientToPlayerReference(client, server.MapPlayers.Players[s]);
|
S.SyncClientToPlayerReference(client, server.MapPlayers.Players[s]);
|
||||||
|
|
||||||
var validatedColor = ColorValidator.ValidatePlayerColorAndGetAlternative(server, client.Color, client.Index, conn);
|
if (!slot.LockColor)
|
||||||
client.PreferredColor = client.Color = validatedColor;
|
{
|
||||||
|
var validatedColor = ColorValidator.ValidatePlayerColorAndGetAlternative(server, client.Color, client.Index, conn);
|
||||||
|
client.PreferredColor = client.Color = validatedColor;
|
||||||
|
}
|
||||||
|
|
||||||
server.SyncLobbyClients();
|
server.SyncLobbyClients();
|
||||||
CheckAutoStart(server);
|
CheckAutoStart(server);
|
||||||
@@ -367,7 +370,8 @@ namespace OpenRA.Mods.Common.Server
|
|||||||
foreach (var c in server.LobbyInfo.Clients)
|
foreach (var c in server.LobbyInfo.Clients)
|
||||||
{
|
{
|
||||||
// Validate if color is allowed and get an alternative it isn't
|
// Validate if color is allowed and get an alternative it isn't
|
||||||
c.Color = c.PreferredColor = ColorValidator.ValidatePlayerColorAndGetAlternative(server, c.Color, c.Index, conn);
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
server.SyncLobbyInfo();
|
server.SyncLobbyInfo();
|
||||||
|
|||||||
Reference in New Issue
Block a user