From a3f3dd649f5a177d4e42bc4f443a3a127574dd45 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sun, 8 Mar 2020 00:02:43 -0500 Subject: [PATCH 1/2] Fix guest deletion confirmation returning to Record Attack menu from Nights Mode menu --- src/m_menu.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 72e2d57e0..712fd2cd7 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -10103,10 +10103,7 @@ static void M_EraseGuest(INT32 choice) (void)choice; if (FIL_FileExists(rguest)) remove(rguest); - if (currentMenu == &SP_NightsGuestReplayDef) - M_SetupNextMenu(&SP_NightsAttackDef); - else - M_SetupNextMenu(&SP_TimeAttackDef); + M_SetupNextMenu(currentMenu->prevMenu->prevMenu); Nextmap_OnChange(); M_StartMessage(M_GetText("Guest replay data erased.\n"),NULL,MM_NOTHING); } From e5270ad9c71a79b0bc95561b2d8cd55306d3d5f7 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sun, 8 Mar 2020 00:34:15 -0500 Subject: [PATCH 2/2] Fix guest data being deleted regardless of choice --- src/m_menu.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 712fd2cd7..75774c74c 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -10100,9 +10100,12 @@ static void M_ReplayTimeAttack(INT32 choice) static void M_EraseGuest(INT32 choice) { const char *rguest = va("%s"PATHSEP"replay"PATHSEP"%s"PATHSEP"%s-guest.lmp", srb2home, timeattackfolder, G_BuildMapName(cv_nextmap.value)); - (void)choice; - if (FIL_FileExists(rguest)) - remove(rguest); + + if (choice == 'y' || choice == KEY_ENTER) + { + if (FIL_FileExists(rguest)) + remove(rguest); + } M_SetupNextMenu(currentMenu->prevMenu->prevMenu); Nextmap_OnChange(); M_StartMessage(M_GetText("Guest replay data erased.\n"),NULL,MM_NOTHING);