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

Check if MovingSprite type change call is initial #2646

Merged
merged 6 commits into from
Jan 30, 2024

Conversation

Vankata453
Copy link
Member

@Vankata453 Vankata453 commented Sep 25, 2023

Removes an old MovingSprite::has_found_sprite() hack, which allowed getting whether a custom sprite has been found only the first time it's called. After the first call, m_sprite_found always equaled to false.

MovingSprite::on_type_change now checks if the call is initial, and if so, only sets the default sprite for the type, if a custom sprite hasn't just been loaded.

Closes #1342. Fixes #2701.

Removes an old `MovingSprite::has_found_sprite()` hack, which allowed getting whether a custom sprite has been found only the first time it's called. After the first call, `m_sprite_found` always equaled to `false`.

`MovingSprite::on_type_change` now checks if the call is initial, and if so, only sets the default sprite for the type, if a custom sprite hasn't just been loaded.

Closes SuperTux#1342.
@Vankata453 Vankata453 mentioned this pull request Sep 25, 2023
@mrkubax10 mrkubax10 added category:code status:needs-review Work needs to be reviewed by other people type:bugfix Pull Requests that fix bugs. labels Oct 7, 2023
@tobbi
Copy link
Member

tobbi commented Dec 21, 2023

Can we move -1 to a constant with a proper name?

@Vankata453
Copy link
Member Author

Can we move -1 to a constant with a proper name?

I've replaced -1 with the TypeChange::INITIAL enumerator.

@Vankata453
Copy link
Member Author

@tobbi Can you re-review this one?

src/badguy/crusher.cpp Outdated Show resolved Hide resolved
@mrkubax10 mrkubax10 merged commit 88674c6 into SuperTux:master Jan 30, 2024
32 of 33 checks passed
@mrkubax10 mrkubax10 removed the status:needs-review Work needs to be reviewed by other people label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:code type:bugfix Pull Requests that fix bugs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to set custom sprites to springs Spring sprite changing back in editor
4 participants