mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'fix-credits-demo-rec-crash' into 'master'
Reset demobuf even when not saving a demo Closes #1254 See merge request KartKrew/Kart!2246
This commit is contained in:
commit
f4ea9cf8ca
3 changed files with 15 additions and 3 deletions
|
|
@ -4053,6 +4053,10 @@ boolean G_CheckDemoStatus(void)
|
|||
{
|
||||
G_SaveDemo();
|
||||
}
|
||||
else
|
||||
{
|
||||
G_ResetDemoRecording();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -4064,6 +4068,12 @@ boolean G_CheckDemoStatus(void)
|
|||
return false;
|
||||
}
|
||||
|
||||
void G_ResetDemoRecording(void)
|
||||
{
|
||||
Z_Free(demobuf.buffer);
|
||||
demo.recording = false;
|
||||
}
|
||||
|
||||
void G_SaveDemo(void)
|
||||
{
|
||||
UINT8 *p = demobuf.buffer+16; // after version
|
||||
|
|
@ -4138,8 +4148,7 @@ void G_SaveDemo(void)
|
|||
#endif
|
||||
|
||||
bool saved = FIL_WriteFile(demoname, demobuf.buffer, demobuf.p - demobuf.buffer); // finally output the file.
|
||||
Z_Free(demobuf.buffer);
|
||||
demo.recording = false;
|
||||
G_ResetDemoRecording();
|
||||
|
||||
if (!modeattacking)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -238,6 +238,7 @@ void G_LoadDemoInfo(menudemo_t *pdemo, boolean allownonmultiplayer);
|
|||
void G_DeferedPlayDemo(const char *demo);
|
||||
|
||||
void G_SaveDemo(void);
|
||||
void G_ResetDemoRecording(void);
|
||||
|
||||
boolean G_CheckDemoTitleEntry(void);
|
||||
|
||||
|
|
|
|||
|
|
@ -4141,7 +4141,7 @@ void G_GetNextMap(void)
|
|||
// A gamedata save will happen on successful level enter
|
||||
|
||||
// Also set character, color, and follower from profile
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4697,6 +4697,8 @@ void G_AfterIntermission(void)
|
|||
}
|
||||
else if (demo.recording && (modeattacking || demo.willsave))
|
||||
G_SaveDemo();
|
||||
else if (demo.recording)
|
||||
G_ResetDemoRecording();
|
||||
|
||||
if (modeattacking) // End the run.
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue