From c7503a492d2f0caa8d258bca1db77d3b7635ace7 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 4 Apr 2024 21:36:51 +0100 Subject: [PATCH 1/3] Simpler solution to #1225: If a retry flag occurs in a demo, stop playback immediately! --- src/g_game.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index fa2ca0839..c6a75d9f1 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1791,11 +1791,17 @@ void G_Ticker(boolean run) P_MapStart(); - if (gamestate == GS_LEVEL) + if (gamestate == GS_LEVEL && G_GetRetryFlag()) { - // Or, alternatively, retry. - if (G_GetRetryFlag()) + if (demo.playback == true) { + // Stop playback!! + G_ClearRetryFlag(); + G_CheckDemoStatus(); + } + else + { + // Or, alternatively, retry. for (i = 0; i < MAXPLAYERS; i++) { if (playeringame[i]) From 6a07bca807238e0d5da134667e97efa923e81d48 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 5 Apr 2024 21:59:20 +0100 Subject: [PATCH 2/3] Minimal set of calls to dump you back to the EggTV menu as soon as possible My patience is thin, let's just work around the crash as tightly as possible --- src/g_game.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index c6a75d9f1..83943e043 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1797,7 +1797,15 @@ void G_Ticker(boolean run) { // Stop playback!! G_ClearRetryFlag(); - G_CheckDemoStatus(); + // G_CheckDemoStatus() called here fails an I_Assert in g_party.cpp Console()!? + // I'm sure there's a completely logical explanation and an elegant solution + // where we can defer some sort of state change. However I'm tired, I've been + // looking after my niece, my arm hurts a bit when using mouse/keyboard, and + // we are ALMOST DONE. So I'm going to bodge this for the sake of release. + // The minimal set of calls to dump you back to the menu as soon as possible + // will have to do, so that everybody can have fun racing as rings. ~toast 050424 + G_StopDemo(); + Command_ExitGame_f(); } else { From d618802abccf953da371dffbb2a41d087fdd6e43 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 6 Apr 2024 23:51:18 +0100 Subject: [PATCH 3/3] Additional hack for Sealed Star game over: In demo.playback, do a retry flag anyways, just to guarantee it ends Also guarantee it uses demo.netgame status where relevant --- src/g_game.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 83943e043..0275c7942 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3132,10 +3132,11 @@ void G_FinishExitLevel(void) if (gamestate == GS_LEVEL) { + const boolean worknetgame = (demo.playback ? demo.netgame : netgame); if (g_exit.retry) { // Restart cup here whenever we do Online GP - if (!netgame) + if (!worknetgame) { // We have lives, just redo this one course. G_SetRetryFlag(); @@ -3144,11 +3145,18 @@ void G_FinishExitLevel(void) } else if (g_exit.losing) { - // We were in a Special Stage. + // Were we in a Special Stage? // We can still progress to the podium when we game over here. const boolean special = grandprixinfo.gp == true && grandprixinfo.cup != NULL && grandprixinfo.eventmode == GPEVENT_SPECIAL; - if (!netgame && !special) + if (demo.playback && !worknetgame) + { + // Guarantee conclusion to Sealed Star replay + G_SetRetryFlag(); + return; + } + + if (!worknetgame && !special) { // Back to the menu with you. G_HandleSaveLevel(true);