diff --git a/KeepersCompound.LGS/Database/Chunks/WorldRep.cs b/KeepersCompound.LGS/Database/Chunks/WorldRep.cs index 5e3e35f..4b797b7 100644 --- a/KeepersCompound.LGS/Database/Chunks/WorldRep.cs +++ b/KeepersCompound.LGS/Database/Chunks/WorldRep.cs @@ -260,12 +260,7 @@ public class WorldRep : IChunk // the hue/saturation of coloured lights. Got to make sure we // maintain the colour ratios. var c = color * strength; - var ratio = 0.0f; - foreach (var e in new float[] { c.X, c.Y, c.Z }) - { - ratio = Math.Max(ratio, e / 255.0f); - } - + var ratio = Math.Max(Math.Max(Math.Max(0.0f, c.X), c.Y), c.Z) / 255.0f; if (ratio > 1.0f) { c /= ratio;