M_EndModeAttackRun bugfixes

- Correctly restore menu state after failed record attack run
- Making things easier for future work - use demo.title as signifier to go back to title screen
This commit is contained in:
toaster 2023-01-31 14:00:21 +00:00
parent defa4511a8
commit 2d5d5343b1
2 changed files with 13 additions and 6 deletions

View file

@ -4009,8 +4009,6 @@ void G_StopDemo(void)
Z_Free(demobuf.buffer);
demobuf.buffer = NULL;
demo.playback = false;
if (demo.title)
modeattacking = ATTACKING_NONE;
demo.title = false;
demo.timing = false;
singletics = false;

View file

@ -49,14 +49,23 @@ menu_t PAUSE_PlaybackMenuDef = {
void M_EndModeAttackRun(void)
{
boolean dotitle = demo.title;
G_CheckDemoStatus(); // Cancel recording
if (gamestate == GS_LEVEL || gamestate == GS_INTERMISSION)
Command_ExitGame_f();
Command_ExitGame_f(); // Clear a bunch of state
modeattacking = ATTACKING_NONE;
modeattacking = ATTACKING_NONE; // Kept until now because of Command_ExitGame_f
M_StartControlPanel();
if (dotitle)
{
D_StartTitle();
}
else
{
D_ClearState();
M_StartControlPanel();
}
}
// Replay Playback Menu