diff --git a/src/d_netcmd.c b/src/d_netcmd.c index fe9cb5e7a..529fce0a9 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3015,9 +3015,19 @@ static void Got_Mapcmd(const UINT8 **cp, INT32 playernum) CON_LogMessage(M_GetText("Speeding off to level...\n")); } + if (demo.playback && !demo.timing) precache = false; + + // Save demo in case map change happened after level finish + // (either manually with the map command, or with a redo vote) + // Isn't needed for time attack (and would also cause issues, as there + // G_RecordDemo (which sets demo.recording to true) is called before this runs) + if (demo.recording && modeattacking == ATTACKING_NONE) + G_CheckDemoStatus(); + + demo.willsave = (cv_recordmultiplayerdemos.value == 2); demo.savebutton = 0; @@ -5719,6 +5729,11 @@ static void Got_SetupVotecmd(const UINT8 **cp, INT32 playernum) memcpy(g_voteLevels, tempVoteLevels, sizeof(g_voteLevels)); + // admin can force vote state whenever + // so we have to save this replay if it needs to be saved + if (demo.recording) + G_CheckDemoStatus(); + G_SetGamestate(GS_VOTING); Y_StartVote(); } diff --git a/src/g_demo.cpp b/src/g_demo.cpp index f0df146b6..d3669d0ca 100644 --- a/src/g_demo.cpp +++ b/src/g_demo.cpp @@ -4212,6 +4212,7 @@ boolean G_CheckDemoStatus(void) if (modeattacking || demo.willsave) { + demo.willsave = false; if (demobuf.p) { G_SaveDemo(); diff --git a/src/g_game.c b/src/g_game.c index 8dd9db924..d731b5659 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -5079,7 +5079,10 @@ void G_AfterIntermission(void) return; } else if (demo.recording && (modeattacking || demo.willsave)) + { + demo.willsave = false; G_SaveDemo(); + } else if (demo.recording) G_ResetDemoRecording();