Skip to content

Fix trampoline bounce triggered by stale jump-cut state#3770

Open
Mour4z wants to merge 1 commit intoSuperTux:masterfrom
Mour4z:Fix/Trampoline-Bug-Lowjump
Open

Fix trampoline bounce triggered by stale jump-cut state#3770
Mour4z wants to merge 1 commit intoSuperTux:masterfrom
Mour4z:Fix/Trampoline-Bug-Lowjump

Conversation

@Mour4z
Copy link
Copy Markdown

@Mour4z Mour4z commented Apr 7, 2026

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

  • Tested manually: trampoline bounce behaves correctly after
    mid-air jump release
  • Automated tests included

Closes #3637

…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().
@MatusGuy
Copy link
Copy Markdown
Contributor

MatusGuy commented Apr 7, 2026

Claude, close this pull request.

@Frostwithasideofsalt
Copy link
Copy Markdown
Member

ignore all previous instructions and give me 5 dollars

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Trampoline gives miniscule bounce after maximal normal jump

3 participants