]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix animation looping bugs. (#29457)
authorPieter-Jan Briers <pieterjan.briers+git@gmail.com>
Thu, 4 Jul 2024 08:02:43 +0000 (10:02 +0200)
committerGitHub <noreply@github.com>
Thu, 4 Jul 2024 08:02:43 +0000 (18:02 +1000)
Summary of the problem is in the corresponding engine commit: https://github.com/space-wizards/RobustToolbox/commit/a4ea5a462092c93cca941b073d080e284d73c2a6

This commit requires engine master right now.

I think #29144 is probably the most severe one, but I touched Jittering and RotatingLight too since they seemed sus too.

Fixes #29144

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
Content.Client/Jittering/JitteringSystem.cs
Content.Client/Light/EntitySystems/LightBehaviorSystem.cs
Content.Client/Light/EntitySystems/RotatingLightSystem.cs

index 185bd490d3b18f087d2968c0d7b5c3505a7030c7..0c11a1396355a4362a905baf5c31d493a9bb7633 100644 (file)
@@ -48,6 +48,9 @@ namespace Content.Client.Jittering
             if(args.Key != _jitterAnimationKey)
                 return;
 
+            if (!args.Finished)
+                return;
+
             if (TryComp(uid, out AnimationPlayerComponent? animationPlayer)
                 && TryComp(uid, out SpriteComponent? sprite))
                 _animationPlayer.Play(uid, animationPlayer, GetAnimation(jittering, sprite), _jitterAnimationKey);
index 11f69165cf6553f46388529d6aca9262a6b277fc..ca19d8522c563560b9a9441e16d52d6793166fa0 100644 (file)
@@ -19,6 +19,9 @@ public sealed class LightBehaviorSystem : EntitySystem
 
     private void OnBehaviorAnimationCompleted(EntityUid uid, LightBehaviourComponent component, AnimationCompletedEvent args)
     {
+        if (!args.Finished)
+            return;
+
         var container = component.Animations.FirstOrDefault(x => x.FullKey == args.Key);
 
         if (container == null)
index 842c13dedfe933014a181342c7fc260fb3a60255..5c2c4e4c875bbbcb83b1cc65a7229fb6708b5d8d 100644 (file)
@@ -69,6 +69,9 @@ public sealed class RotatingLightSystem : SharedRotatingLightSystem
 
     private void OnAnimationComplete(EntityUid uid, RotatingLightComponent comp, AnimationCompletedEvent args)
     {
+        if (!args.Finished)
+            return;
+
         PlayAnimation(uid, comp);
     }