From 1eff7bfbe80db88b96e5b0619a34bcac7b2e67a1 Mon Sep 17 00:00:00 2001 From: fickleheart Date: Sat, 6 Apr 2019 18:17:56 -0500 Subject: [PATCH] Fix title menu not working if you leave a replay early --- src/m_menu.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index c3d2397f..7c82bc31 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -352,6 +352,7 @@ static void M_PlaybackFastForward(INT32 choice); static void M_PlaybackAdvance(INT32 choice); static void M_PlaybackSetViews(INT32 choice); static void M_PlaybackAdjustView(INT32 choice); +static void M_PlaybackQuit(INT32 choice); // Drawing functions static void M_DrawGenericMenu(void); @@ -583,7 +584,7 @@ static menuitem_t PlaybackMenu[] = {IT_ARROWS | IT_STRING, "M_PNVIEW", "Viewpoint 4", M_PlaybackAdjustView, 144}, {IT_CALL | IT_STRING, "M_POPTS", "More Options...", M_ReplayHut, 168}, - {IT_CALL | IT_STRING, "M_PEXIT", "Stop Playback", M_ReplayHut, 184}, + {IT_CALL | IT_STRING, "M_PEXIT", "Stop Playback", M_PlaybackQuit, 184}, }; typedef enum { @@ -5864,6 +5865,19 @@ static void M_PlaybackAdjustView(INT32 choice) G_AdjustView(itemOn - playback_viewcount, (choice > 0) ? 1 : -1, true); } +static void M_PlaybackQuit(INT32 choice) +{ + (void)choice; + G_StopDemo(); + + if (demo.inreplayhut) + M_ReplayHut(choice); + else if (modeattacking) + S_ChangeMusicInternal("racent", true); // ??? + else + D_StartTitle(); +} + static void M_PandorasBox(INT32 choice) { (void)choice;