Skip to content

fix: prevent stage select confirming on the character select press - #3780

Closed
mathmati wants to merge 1 commit into
ikemen-engine:developfrom
mathmati:fix-stage-select-confirm
Closed

mathmati wants to merge 1 commit into
ikemen-engine:developfrom
mathmati:fix-stage-select-confirm

Conversation

@mathmati

Copy link
Copy Markdown

This is a bug I encountered on the browser version and the cause is in the main branch too, not sure its encountered in the main game version.

In f_selectScreen(), the confirm press that completes character/palette selection is still readable by getInput() later in the same frame's pass, so the stage bar can confirm itself instantly on slot 0 (random). The stage that loads then mismatches the label the player last saw.

Ignore the confirm on the first frame the stage menu is active, that frame carries the leftover selection press; a fresh press is required to choose the stage.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR title matches our git commit title formatting guidelines. All good!

In f_selectScreen(), the confirm press that completes character/palette
selection is still readable by getInput() later in the same frame's
pass, so the stage bar can confirm itself instantly on slot 0 (random).
The stage that loads then mismatches the label the player last saw.

Ignore the confirm on the first frame the stage menu is active — that
frame carries the leftover selection press; a fresh press is required
to choose the stage.
@mathmati
mathmati force-pushed the fix-stage-select-confirm branch from 05e9019 to a9ea6f8 Compare July 14, 2026 14:51
@mathmati mathmati changed the title Fix stage select confirming on the character-select press fix: prevent stage select confirming on the character-select press Jul 14, 2026
@github-actions github-actions Bot added the PR: fix This PR implements changes that don't belong to other categories label Jul 14, 2026
@mathmati mathmati changed the title fix: prevent stage select confirming on the character-select press fix: prevent stage select confirming on the character select press Jul 14, 2026
@github-actions github-actions Bot added PR: fix This PR implements changes that don't belong to other categories and removed PR: fix This PR implements changes that don't belong to other categories labels Jul 14, 2026
@K4thos

K4thos commented Jul 14, 2026

Copy link
Copy Markdown
Member

I can't reproduce this issue on either the nightly or your WebAssembly build. Before the fix is merged, we need to verify that the issue actually exists, so reproduction steps or more details are needed. We discuss the reproducibility of it is here: https://discord.com/channels/233345562261323776/233363722934943744/1526607191266693211

Also, while AI assistance is allowed, generated comments should still be reviewed manually. Generally, the more comments the better, but four lines explaining something this simple feels excessive. I would either remove the comment entirely or shorten it to something like:

-- Ignore the carried-over confirm input to avoid instantly selecting a random stage.

@K4thos K4thos added the under discussion PR in review / under discussion label Sep 12, 2026
@K4thos
K4thos force-pushed the develop branch 3 times, most recently from 3e81055 to 3f92a78 Compare September 12, 2026 16:15
@K4thos

K4thos commented Sep 16, 2026

Copy link
Copy Markdown
Member

Apparently the bug was found only in the browser version, so before merging it we might as well wait for it and test afterwards. btw. @mathmati feel free to open the pr for upstreaming the wasm build

@K4thos K4thos closed this Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix This PR implements changes that don't belong to other categories under discussion PR in review / under discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants