Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

CaasGit
Copy link
Contributor

@CaasGit CaasGit commented Jul 16, 2024

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

  • [ x ] I have added screenshots/videos to this PR showcasing its changes ingame, or this PR does not require an ingame showcase

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.
Comment on lines +56 to +59
if (HasComp<AnimationPlayerComponent>(uid)
&& TryComp(uid, out SpriteComponent? sprite)
&& !_animationPlayer.HasRunningAnimation(uid, _jitterAnimationKey))
_animationPlayer.Play(uid, GetAnimation(jittering, sprite), _jitterAnimationKey);
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@metalgearsloth metalgearsloth added the S: Awaiting Changes Status: Changes are required before another review can happen label Jul 17, 2024
@SlamBamActionman SlamBamActionman added the S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. label Nov 14, 2024
@eoineoineoin eoineoineoin added T: Bugfix Type: Bugs and/or bugfixes P2: Raised Priority: Item has a raised priority, indicating it might get increased maintainer attention. D3: Low Difficulty: Some codebase knowledge required. A: Core Tech Area: Underlying core tech for the game and the Github repository. and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: Core Tech Area: Underlying core tech for the game and the Github repository. D3: Low Difficulty: Some codebase knowledge required. P2: Raised Priority: Item has a raised priority, indicating it might get increased maintainer attention. S: Awaiting Changes Status: Changes are required before another review can happen T: Bugfix Type: Bugs and/or bugfixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants