diff --git a/Content.Client/Movement/Systems/WaddleAnimationSystem.cs b/Content.Client/Movement/Systems/WaddleAnimationSystem.cs index 7aab9427d5..e6a88cb485 100644 --- a/Content.Client/Movement/Systems/WaddleAnimationSystem.cs +++ b/Content.Client/Movement/Systems/WaddleAnimationSystem.cs @@ -1,5 +1,6 @@ using System.Numerics; using Content.Client.Gravity; +using Content.Shared.Rotation; using Content.Shared.Movement.Components; using Content.Shared.Movement.Events; using Robust.Client.Animations; @@ -14,6 +15,7 @@ public sealed class WaddleAnimationSystem : EntitySystem [Dependency] private readonly AnimationPlayerSystem _animation = default!; [Dependency] private readonly GravitySystem _gravity = default!; [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly AppearanceSystem _appearance = default!; // WD EDIT public override void Initialize() { @@ -32,7 +34,13 @@ public sealed class WaddleAnimationSystem : EntitySystem return; } - if (!args.HasDirectionalMovement && component.IsCurrentlyWaddling) + // WD EDIT + _appearance.TryGetData(entity, RotationVisuals.RotationState, out var state); + if (state is RotationState.Horizontal) + return; + // WD EDIT + + if (!args.HasDirectionalMovement && component.IsCurrentlyWaddling) { component.IsCurrentlyWaddling = false; @@ -71,6 +79,12 @@ public sealed class WaddleAnimationSystem : EntitySystem return; } + // WD EDIT + _appearance.TryGetData(uid, RotationVisuals.RotationState, out var state); + if (TryComp(uid, out var sprite) && TryComp(uid, out var rotat) && state is RotationState.Horizontal) + return; + // WD EDIT + var tumbleIntensity = component.LastStep ? 360 - component.TumbleIntensity : component.TumbleIntensity; var len = mover.Sprinting ? component.AnimationLength * component.RunAnimationLengthMultiplier : component.AnimationLength; @@ -128,8 +142,13 @@ public sealed class WaddleAnimationSystem : EntitySystem private void OnAnimationCompleted(EntityUid uid, WaddleAnimationComponent component, AnimationCompletedEvent args) { - var started = new StartedWaddlingEvent(uid); + if (args.Key is not "Waddle") // WD EDIT + { + component.IsCurrentlyWaddling = false; + return; + } + var started = new StartedWaddlingEvent(uid); RaiseLocalEvent(uid, ref started); } } diff --git a/Content.Client/Rotation/RotationVisualizerSystem.cs b/Content.Client/Rotation/RotationVisualizerSystem.cs index 6105c10c80..eadc7de05a 100644 --- a/Content.Client/Rotation/RotationVisualizerSystem.cs +++ b/Content.Client/Rotation/RotationVisualizerSystem.cs @@ -55,6 +55,10 @@ public sealed class RotationVisualizerSystem : SharedRotationVisualsSystem _animation.Stop(animationComp, animationKey); } + // WD EDIT + if (_animation.HasRunningAnimation(animationComp, "Waddle")) + _animation.Stop(animationComp, "Waddle"); + var animation = new Animation { Length = TimeSpan.FromSeconds(animationTime),