]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Try fix RGBee (#28741)
authorLeon Friedrich <60421075+ElectroJr@users.noreply.github.com>
Sat, 8 Jun 2024 10:27:21 +0000 (22:27 +1200)
committerGitHub <noreply@github.com>
Sat, 8 Jun 2024 10:27:21 +0000 (20:27 +1000)
Content.Client/Light/RgbLightControllerSystem.cs

index 7d55bcebf113ffe538ca0f23e1832d421d94ddd7..85b611483061139159933a2090b9bae901b95726 100644 (file)
@@ -207,8 +207,11 @@ namespace Content.Client.Light
 
         public static Color GetCurrentRgbColor(TimeSpan curTime, TimeSpan offset, Entity<RgbLightControllerComponent> 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