Light warnings cleanup (#36195)
* Light warnings cleanup * Using EntitySystem Proxy overrides * New TryComp guards for light animations * Reverting guards when not wanted
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user