Skip to content

Commit a9ea6f8

Browse files
committed
fix: prevent stage select confirming on the character-select press
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.
1 parent 8dbd863 commit a9ea6f8

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

external/script/start.lua

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ start.challenger = 0
1313
local restoreCursor = false
1414
local selScreenEnd = false
1515
local stageEnd = false
16+
local stageMenuReady = false
1617
local stageRandom = false
1718
local stageListNo = 0
1819
local t_aiRamp = {}
@@ -1918,6 +1919,7 @@ function start.f_selectReset(hardReset, preserveProgress)
19181919
end
19191920
selScreenEnd = false
19201921
stageEnd = false
1922+
stageMenuReady = false
19211923
t_reservedChars = {{}, {}}
19221924
cursorActive = {}
19231925
cursorDone = {}
@@ -2814,7 +2816,12 @@ function start.f_selectScreen()
28142816
main.f_animPosDraw(anim, x, y)
28152817
end
28162818
if not stageEnd then
2817-
local canConfirmStage = (getInput(-1, motif.select_info.done.key) and not screenDelayInterrupted) or timerSelect == -1
2819+
-- Ignore the confirm press on the first frame the stage menu is
2820+
-- active: it is the same press that just completed character
2821+
-- selection, still readable by getInput() in this pass, and would
2822+
-- otherwise confirm the stage (slot 0 = random) instantly.
2823+
local canConfirmStage = ((stageMenuReady and getInput(-1, motif.select_info.done.key)) and not screenDelayInterrupted) or timerSelect == -1
2824+
stageMenuReady = true
28182825
if canConfirmStage then
28192826
local preloadReady = true
28202827
if stageListNo > 0 then

0 commit comments

Comments
 (0)