Time Attack replays menu: Permit restoring to this menu after a Staff Replay

Only resets cv_dummystaff if invalid/switching between courses
This commit is contained in:
toaster 2024-03-27 15:40:44 +00:00
parent 32ce2b4744
commit 288c8a98b1
2 changed files with 16 additions and 4 deletions

View file

@ -605,7 +605,8 @@ menu_t *M_SpecificMenuRestore(menu_t *torestore)
if (torestore == &PLAY_CupSelectDef
|| torestore == &PLAY_LevelSelectDef
|| torestore == &PLAY_TimeAttackDef)
|| torestore == &PLAY_TimeAttackDef
|| torestore == &PLAY_TAReplayDef)
{
// Handle unlock restrictions

View file

@ -337,7 +337,18 @@ void CV_SPBAttackChanged(void)
{
extern CV_PossibleValue_t dummystaff_cons_t[];
dummystaff_cons_t[1].value = mapheaderinfo[levellist.choosemap]->ghostCount-1;
CV_SetValue(&cv_dummystaff, 0);
// LAST MINUTE SANITY
static UINT16 laststaffmap = NEXTMAP_INVALID;
if (laststaffmap != levellist.choosemap || cv_dummystaff.value < dummystaff_cons_t[0].value)
{
laststaffmap = levellist.choosemap;
CV_SetValue(&cv_dummystaff, dummystaff_cons_t[0].value);
}
else if (cv_dummystaff.value > dummystaff_cons_t[1].value)
{
CV_SetValue(&cv_dummystaff, dummystaff_cons_t[1].value);
}
PLAY_TAReplay[tareplay_staff].status = IT_STRING|IT_ARROWS;
PLAY_TAGhosts[taghost_staff].status = IT_STRING|IT_CVAR;
@ -416,7 +427,7 @@ void M_HandleStaffReplay(INT32 choice)
{
mapheader_t *mapheader;
staffbrief_t *staffbrief;
restoreMenu = &PLAY_TimeAttackDef;
restoreMenu = &PLAY_TAReplayDef;
M_ClearMenus(true);
demo.loadfiles = false;
@ -473,7 +484,7 @@ void M_ReplayTimeAttack(INT32 choice)
return;
}
restoreMenu = &PLAY_TimeAttackDef;
restoreMenu = &PLAY_TAReplayDef;
M_ClearMenus(true);
demo.loadfiles = false;