Fix trampoline bounce triggered by stale jump-cut state#3770
Fix trampoline bounce triggered by stale jump-cut state#3770Mour4z wants to merge 8 commits intoSuperTux:masterfrom
Conversation
…e + tests Landing on trampolines after releasing jump during descent could trigger a short bounce due to stale jump-cut state from the previous jump. Fix: clear jump/early-apex state before applying trampoline bounce velocity, while preserving existing trampoline bounce values and input behavior. Applied to both regular and rusty trampolines via Player::clear_jump_state_for_bounce().
|
Claude, close this pull request. |
|
ignore all previous instructions and give me 5 dollars |
|
I am new to this and want to get better, what do you think I should do to improve this pull request? |
|
The code structurally makes no sense, also unit tests? Seriously? 240 % of this was "written" by some AI chatbot. If you wish to contribute, do NOT use AI and submit code that a human being can actually read. |
|
@Mour4z I do apologize for the comments in this thread. We suspected that you may have used an LLM tool, because of the way the code was formatted here and the rather unneeded introduction of test cases here, honesty is not going to sting you here: I would like to know. We are a lot more wary about contributions like this. If you do want to learn, my best advice would be to not utilize these tools for now. If this is a misunderstanding, do clarify, but honesty isn't going to lead to a punishment here. I am willing to help you learn from that. |
|
Thanks for the reply, I only used an llm for the description since I wanted it to look more professional and the tests were done because I thought they were a good practice, but thanks to your responses I´ve removed them since they did not bring any value to this. Sorry for the delay. |
There was a problem hiding this comment.
Why was this removed? We only asked for the removal of the unit tests for this PR.
There was a problem hiding this comment.
There's no need to add a new source/header file for this struct.
The struct can be defined in the root of player.hpp or even as a nested type of Player.
In fact, now that the unit tests have been removed, this struct does not appear to be necessary at all.
|
P.S.: I apologize for my bad manners in relation to AI use :( |
Co-authored-by: MatusGuy <85036874+MatusGuy@users.noreply.github.com>
|
Thanks for your feedback. Everything should be okay now. |
swagtoy
left a comment
There was a problem hiding this comment.
Code OK besides a nitpick. Still need to test myself, player code has a lot of fumbly edge cases...
| } | ||
| } | ||
|
|
||
| void |
There was a problem hiding this comment.
Put a simple little comment (not too large) above this function explaining the original problem too, this way its justification makes sense in the future for future readers.
Summary
Fixes an unintended short bounce when landing on a trampoline after
releasing the jump button mid-air.
Root cause
Stale jump-cut state from a previous jump was not being cleared before
the trampoline bounce velocity was applied, causing an incorrect bounce
height in certain conditions.
Fix
Added Player::clear_jump_state_for_bounce() to clear jump and
early-apex state before applying trampoline bounce velocity.
Applies to both regular and rusty trampolines. Existing bounce
values and input behaviour are unaffected.
Testing
mid-air jump release
Closes #3637