]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Light warnings cleanup (#36195)
authorJ <billsmith116@gmail.com>
Mon, 31 Mar 2025 18:25:00 +0000 (18:25 +0000)
committerGitHub <noreply@github.com>
Mon, 31 Mar 2025 18:25:00 +0000 (20:25 +0200)
* Light warnings cleanup

* Using EntitySystem Proxy overrides

* New TryComp guards for light animations

* Reverting guards when not wanted

Content.Client/Light/EntitySystems/RotatingLightSystem.cs
Content.Client/Light/Visualizers/PoweredLightVisualizerSystem.cs

index 5c2c4e4c875bbbcb83b1cc65a7229fb6708b5d8d..1e20d7041a781bb533e69852c66539e29e5bb7da 100644 (file)
@@ -85,7 +85,7 @@ public sealed class RotatingLightSystem : SharedRotatingLightSystem
 
         if (!_animations.HasRunningAnimation(uid, player, AnimKey))
         {
-            _animations.Play(uid, player, GetAnimation(comp.Speed), AnimKey);
+            _animations.Play((uid, player), GetAnimation(comp.Speed), AnimKey);
         }
     }
 }
index ee81641d2631c27e5140271c9741efc4181e1e85..c07742462bee2f58b9cc1c3054fbf1dd5d857d42 100644 (file)
@@ -2,7 +2,6 @@ using Content.Shared.Light;
 using Robust.Client.Animations;
 using Robust.Client.GameObjects;
 using Robust.Shared.Animations;
-using Robust.Shared.Audio;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Random;
 
@@ -53,13 +52,14 @@ public sealed class PoweredLightVisualizerSystem : VisualizerSystem<PoweredLight
     /// </summary>
     private void OnAnimationCompleted(EntityUid uid, PoweredLightVisualsComponent comp, AnimationCompletedEvent args)
     {
+        if (!TryComp<AnimationPlayerComponent>(uid, out var animationPlayer))
+            return;
         if (args.Key != PoweredLightVisualsComponent.BlinkingAnimationKey)
             return;
-
         if(!comp.IsBlinking)
             return;
 
-        AnimationSystem.Play(uid, Comp<AnimationPlayerComponent>(uid), BlinkingAnimation(comp), PoweredLightVisualsComponent.BlinkingAnimationKey);
+        AnimationSystem.Play((uid, animationPlayer), BlinkingAnimation(comp), PoweredLightVisualsComponent.BlinkingAnimationKey);
     }
 
     /// <summary>
@@ -76,7 +76,7 @@ public sealed class PoweredLightVisualizerSystem : VisualizerSystem<PoweredLight
         var animationPlayer = EnsureComp<AnimationPlayerComponent>(uid);
         if (shouldBeBlinking)
         {
-            AnimationSystem.Play(uid, animationPlayer, BlinkingAnimation(comp), PoweredLightVisualsComponent.BlinkingAnimationKey);
+            AnimationSystem.Play((uid, animationPlayer), BlinkingAnimation(comp), PoweredLightVisualsComponent.BlinkingAnimationKey);
         }
         else if (AnimationSystem.HasRunningAnimation(uid, animationPlayer, PoweredLightVisualsComponent.BlinkingAnimationKey))
         {