mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'allow-replay-saving-map-change' into 'master'
Save replay if map abruptly changes Closes #316, #276, and #242 See merge request kart-krew-dev/ring-racers!63
This commit is contained in:
commit
303401aea5
3 changed files with 19 additions and 0 deletions
|
|
@ -3015,9 +3015,19 @@ static void Got_Mapcmd(const UINT8 **cp, INT32 playernum)
|
||||||
CON_LogMessage(M_GetText("Speeding off to level...\n"));
|
CON_LogMessage(M_GetText("Speeding off to level...\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (demo.playback && !demo.timing)
|
if (demo.playback && !demo.timing)
|
||||||
precache = false;
|
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.willsave = (cv_recordmultiplayerdemos.value == 2);
|
||||||
demo.savebutton = 0;
|
demo.savebutton = 0;
|
||||||
|
|
||||||
|
|
@ -5719,6 +5729,11 @@ static void Got_SetupVotecmd(const UINT8 **cp, INT32 playernum)
|
||||||
|
|
||||||
memcpy(g_voteLevels, tempVoteLevels, sizeof(g_voteLevels));
|
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);
|
G_SetGamestate(GS_VOTING);
|
||||||
Y_StartVote();
|
Y_StartVote();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4212,6 +4212,7 @@ boolean G_CheckDemoStatus(void)
|
||||||
|
|
||||||
if (modeattacking || demo.willsave)
|
if (modeattacking || demo.willsave)
|
||||||
{
|
{
|
||||||
|
demo.willsave = false;
|
||||||
if (demobuf.p)
|
if (demobuf.p)
|
||||||
{
|
{
|
||||||
G_SaveDemo();
|
G_SaveDemo();
|
||||||
|
|
|
||||||
|
|
@ -5079,7 +5079,10 @@ void G_AfterIntermission(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (demo.recording && (modeattacking || demo.willsave))
|
else if (demo.recording && (modeattacking || demo.willsave))
|
||||||
|
{
|
||||||
|
demo.willsave = false;
|
||||||
G_SaveDemo();
|
G_SaveDemo();
|
||||||
|
}
|
||||||
else if (demo.recording)
|
else if (demo.recording)
|
||||||
G_ResetDemoRecording();
|
G_ResetDemoRecording();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue