Fix animation looping bugs. (#29457)
Summary of the problem is in the corresponding engine commit: a4ea5a4620
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>
This commit is contained in:
committed by
GitHub
parent
bc7907728c
commit
8d015f5c9f
@@ -48,6 +48,9 @@ namespace Content.Client.Jittering
|
|||||||
if(args.Key != _jitterAnimationKey)
|
if(args.Key != _jitterAnimationKey)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!args.Finished)
|
||||||
|
return;
|
||||||
|
|
||||||
if (TryComp(uid, out AnimationPlayerComponent? animationPlayer)
|
if (TryComp(uid, out AnimationPlayerComponent? animationPlayer)
|
||||||
&& TryComp(uid, out SpriteComponent? sprite))
|
&& TryComp(uid, out SpriteComponent? sprite))
|
||||||
_animationPlayer.Play(uid, animationPlayer, GetAnimation(jittering, sprite), _jitterAnimationKey);
|
_animationPlayer.Play(uid, animationPlayer, GetAnimation(jittering, sprite), _jitterAnimationKey);
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ public sealed class LightBehaviorSystem : EntitySystem
|
|||||||
|
|
||||||
private void OnBehaviorAnimationCompleted(EntityUid uid, LightBehaviourComponent component, AnimationCompletedEvent args)
|
private void OnBehaviorAnimationCompleted(EntityUid uid, LightBehaviourComponent component, AnimationCompletedEvent args)
|
||||||
{
|
{
|
||||||
|
if (!args.Finished)
|
||||||
|
return;
|
||||||
|
|
||||||
var container = component.Animations.FirstOrDefault(x => x.FullKey == args.Key);
|
var container = component.Animations.FirstOrDefault(x => x.FullKey == args.Key);
|
||||||
|
|
||||||
if (container == null)
|
if (container == null)
|
||||||
|
|||||||
@@ -69,6 +69,9 @@ public sealed class RotatingLightSystem : SharedRotatingLightSystem
|
|||||||
|
|
||||||
private void OnAnimationComplete(EntityUid uid, RotatingLightComponent comp, AnimationCompletedEvent args)
|
private void OnAnimationComplete(EntityUid uid, RotatingLightComponent comp, AnimationCompletedEvent args)
|
||||||
{
|
{
|
||||||
|
if (!args.Finished)
|
||||||
|
return;
|
||||||
|
|
||||||
PlayAnimation(uid, comp);
|
PlayAnimation(uid, comp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user