-
-
Notifications
You must be signed in to change notification settings - Fork 494
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
Various crusher fixes #3047
base: master
Are you sure you want to change the base?
Various crusher fixes #3047
Conversation
Will test tm. |
I've added a fix for an issue found by frost, where roots would spawn in the wrong direction. |
@bruhmoent Could you test as well? |
Yes. I will soon. |
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.
Tested
I moved some code out but I don't know what |
@Vankata453 @MatusGuy Can you guys test the code changes and merge maybe? |
src/object/player.cpp
Outdated
if ((hit.left || hit.right)) { | ||
if (m_ignore_sideways_crush) { | ||
m_ignore_sideways_crush = false; | ||
} | ||
else { | ||
kill(true); | ||
} |
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.
If tux isn't killed immediately when crushed vertically, then why can't it also happen here? This way you remove the ignore_sidways_crush thing. But I might be missing something
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.
Tested the sideways crushing behaviour, sometimes gets Tux stuck in the wall when crushed, but he's invincible so it should be fine. I'm just not sure if that might open the door for some glitchy skips in levels.
// If the other object is the player, and the collision is at the | ||
// bottom of the crusher, hurt the player. |
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.
This comment doesn't reflect the changes (sideways collision also now hurts the player).
src/object/player.cpp
Outdated
if ((hit.left || hit.right)) { | ||
if (m_ignore_sideways_crush) { | ||
m_ignore_sideways_crush = false; | ||
} | ||
else { | ||
kill(true); | ||
} |
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.
Couldn't we make it so that despite of the side where Tux was hit from, kill(false)
is performed? Is there a reason for sideways crushing to instantly kill Tux with kill(true)
?
If we do that, m_ignore_sideways_crush
wouldn't be needed.
This also includes some code style improvements to the
Crusher::collision
and relieves some of the mental pain I have when looking at the SuperTux source code.Fixes #3024