From 4c71a0e54d30848df99c246c2a4ae00745e3a869 Mon Sep 17 00:00:00 2001 From: metalgearsloth Date: Fri, 27 Sep 2024 20:04:23 +1000 Subject: [PATCH] Set sprite flicks immediately So on content we have an issue where the animation is played in doorsystem but sprite visibility is controlled by airlocksystem. The issue then is that we get a single frame where the incorrect sprite is shown before it corrects itself. The easiest way to reproduce this is to walk into a door that denies you and observe it shows the incorrect sprite then flickers to the denied one. There might be more systems with these issues which is why I did this here instead. --- .../GameObjects/EntitySystems/AnimationPlayerSystem.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Robust.Client/GameObjects/EntitySystems/AnimationPlayerSystem.cs b/Robust.Client/GameObjects/EntitySystems/AnimationPlayerSystem.cs index 8d3323d6f4a..ce1f0c93f20 100644 --- a/Robust.Client/GameObjects/EntitySystems/AnimationPlayerSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/AnimationPlayerSystem.cs @@ -143,6 +143,14 @@ public void Play(Entity ent, Animation animation, stri } #endif + foreach (var track in animation.AnimationTracks) + { + if (track is not AnimationTrackSpriteFlick) + continue; + + track.AdvancePlayback(ent.Owner, 0, 0, 0f); + } + ent.Comp.PlayingAnimations.Add(key, playback); }