Fix itemOn out-of-bounds event for Main Menu and its ilk.

Was caused by the following actions:
- Starting a game
- Going to the Options menu
- scrolling beyond the 4th entry
- Exiting to title screen
- Opening up main menu again
This commit is contained in:
toaster 2022-09-02 22:05:11 +01:00
parent bcd9c7efba
commit 061eca773b

View file

@ -945,7 +945,7 @@ void M_StartControlPanel(void)
else if (optionsmenu.profilen < 0)
optionsmenu.profilen = 0;
itemOn = 0;
currentMenu->lastOn = 0;
CV_StealthSetValue(&cv_currprofile, -1); // Make sure to reset that as it is set by PR_ApplyProfile which we kind of hack together to force it.
}
@ -966,6 +966,8 @@ void M_StartControlPanel(void)
}
}
itemOn = currentMenu->lastOn;
CON_ToggleOff(); // move away console
}
@ -5719,8 +5721,7 @@ void M_OpenPauseMenu(void)
pausemenu.openoffset = 256;
pausemenu.closing = false;
itemOn = mpause_continue; // Make sure we select "RESUME GAME" by default
currentMenu->lastOn = mpause_continue; // Make sure we select "RESUME GAME" by default
// Now the hilarious balancing act of deciding what options should be enabled and which ones shouldn't be!
// By default, disable anything sensitive: