-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(JitteringSystem): Fix warnings and double Play. #30085
base: master
Are you sure you want to change the base?
Conversation
Fix some warnings within the Jitter system and ensure we're not playing a jitter animation before playing another animation thus throwing an exception. Saw an exception in live within OnStartup of JitteringSystem.
if (HasComp<AnimationPlayerComponent>(uid) | ||
&& TryComp(uid, out SpriteComponent? sprite) | ||
&& !_animationPlayer.HasRunningAnimation(uid, _jitterAnimationKey)) | ||
_animationPlayer.Play(uid, GetAnimation(jittering, sprite), _jitterAnimationKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the animation player be passed in here still?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, there are Play functions that do but they're deprecated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see one that takes in Entity that looks suitable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that the uid in arg0? Or am I missing something here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using public void Play(EntityUid uid, Animation animation, string key)
which basically calls Play the same way in this case, except I guess we could drop the HasComp check if I use it the way as it is in this PR.
About the PR
Fix some warnings within the Jitter system and ensure we're not playing a jitter animation before playing another animation thus throwing an exception. Saw an exception in live within OnStartup of JitteringSystem.
Media