diff --git a/OpenRA.Game/Graphics/HSLColor.cs b/OpenRA.Game/Graphics/HSLColor.cs index 30dadd46f3..17796908a9 100644 --- a/OpenRA.Game/Graphics/HSLColor.cs +++ b/OpenRA.Game/Graphics/HSLColor.cs @@ -95,7 +95,8 @@ namespace OpenRA.Graphics public static bool operator ==(HSLColor me, HSLColor other) { - return me.H == other.H && me.S == other.S && me.L == other.L; + // Binary floating point numbers (float, double) calculations can yield the same RGB color created by different functions with little different HSL representation + return (me.H == other.H && me.S == other.S && me.L == other.L) || me.RGB == other.RGB; } public static bool operator !=(HSLColor me, HSLColor other) { return !(me == other); } diff --git a/OpenRA.Game/Server/Server.cs b/OpenRA.Game/Server/Server.cs index 3fef8bb940..6a67af4f4a 100644 --- a/OpenRA.Game/Server/Server.cs +++ b/OpenRA.Game/Server/Server.cs @@ -306,7 +306,7 @@ namespace OpenRA.Server IpAddress = ((IPEndPoint)newConn.Socket.RemoteEndPoint).Address.ToString(), Index = newConn.PlayerIndex, Slot = LobbyInfo.FirstEmptySlot(), - PreferredColor = handshake.Client.Color, + PreferredColor = handshake.Client.PreferredColor, Color = handshake.Client.Color, Faction = "Random", SpawnPoint = 0,