Skip to content

Commit

Permalink
Set sprite flicks immediately
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
metalgearsloth committed Sep 27, 2024
1 parent 46291af commit 4c71a0e
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ public void Play(Entity<AnimationPlayerComponent> 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);
}

Expand Down

0 comments on commit 4c71a0e

Please sign in to comment.