From: J Date: Mon, 31 Mar 2025 18:25:00 +0000 (+0000) Subject: Light warnings cleanup (#36195) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=3c3cf1d86759362148e698bdad22c92541b9577e;p=space-station-14.git Light warnings cleanup (#36195) * Light warnings cleanup * Using EntitySystem Proxy overrides * New TryComp guards for light animations * Reverting guards when not wanted --- diff --git a/Content.Client/Light/EntitySystems/RotatingLightSystem.cs b/Content.Client/Light/EntitySystems/RotatingLightSystem.cs index 5c2c4e4c87..1e20d7041a 100644 --- a/Content.Client/Light/EntitySystems/RotatingLightSystem.cs +++ b/Content.Client/Light/EntitySystems/RotatingLightSystem.cs @@ -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); } } } diff --git a/Content.Client/Light/Visualizers/PoweredLightVisualizerSystem.cs b/Content.Client/Light/Visualizers/PoweredLightVisualizerSystem.cs index ee81641d26..c07742462b 100644 --- a/Content.Client/Light/Visualizers/PoweredLightVisualizerSystem.cs +++ b/Content.Client/Light/Visualizers/PoweredLightVisualizerSystem.cs @@ -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 private void OnAnimationCompleted(EntityUid uid, PoweredLightVisualsComponent comp, AnimationCompletedEvent args) { + if (!TryComp(uid, out var animationPlayer)) + return; if (args.Key != PoweredLightVisualsComponent.BlinkingAnimationKey) return; - if(!comp.IsBlinking) return; - AnimationSystem.Play(uid, Comp(uid), BlinkingAnimation(comp), PoweredLightVisualsComponent.BlinkingAnimationKey); + AnimationSystem.Play((uid, animationPlayer), BlinkingAnimation(comp), PoweredLightVisualsComponent.BlinkingAnimationKey); } /// @@ -76,7 +76,7 @@ public sealed class PoweredLightVisualizerSystem : VisualizerSystem(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)) {