From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Sat, 8 Jun 2024 10:27:21 +0000 (+1200) Subject: Try fix RGBee (#28741) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=7ef7fe6761dcbf541785210ff361d79bf4080dcc;p=space-station-14.git Try fix RGBee (#28741) --- diff --git a/Content.Client/Light/RgbLightControllerSystem.cs b/Content.Client/Light/RgbLightControllerSystem.cs index 7d55bcebf1..85b6114830 100644 --- a/Content.Client/Light/RgbLightControllerSystem.cs +++ b/Content.Client/Light/RgbLightControllerSystem.cs @@ -207,8 +207,11 @@ namespace Content.Client.Light public static Color GetCurrentRgbColor(TimeSpan curTime, TimeSpan offset, Entity rgb) { + var delta = (float)(curTime - offset).TotalSeconds; + var entOffset = Math.Abs(rgb.Owner.Id * 0.09817f); + var hue = (delta * rgb.Comp.CycleRate + entOffset) % 1; return Color.FromHsv(new Vector4( - (float) (((curTime.TotalSeconds - offset.TotalSeconds) * rgb.Comp.CycleRate + Math.Abs(rgb.Owner.Id * 0.1)) % 1), + MathF.Abs(hue), 1.0f, 1.0f, 1.0f