mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Create folder with branch name when saving replays
This commit is contained in:
parent
a90953c22d
commit
912f9eaa15
2 changed files with 10 additions and 8 deletions
|
|
@ -60,7 +60,7 @@ boolean nodrawers; // for comparative timing purposes
|
||||||
boolean noblit; // for comparative timing purposes
|
boolean noblit; // for comparative timing purposes
|
||||||
tic_t demostarttime; // for comparative timing purposes
|
tic_t demostarttime; // for comparative timing purposes
|
||||||
|
|
||||||
static char demoname[128];
|
static char demoname[MAX_WADPATH];
|
||||||
static UINT8 *demobuffer = NULL;
|
static UINT8 *demobuffer = NULL;
|
||||||
static UINT8 *demotime_p, *demoinfo_p;
|
static UINT8 *demotime_p, *demoinfo_p;
|
||||||
UINT8 *demo_p;
|
UINT8 *demo_p;
|
||||||
|
|
@ -3791,7 +3791,7 @@ void G_SaveDemo(void)
|
||||||
demo_slug[strindex] = 0;
|
demo_slug[strindex] = 0;
|
||||||
if (dash) demo_slug[strindex-1] = 0;
|
if (dash) demo_slug[strindex-1] = 0;
|
||||||
|
|
||||||
writepoint = strstr(demoname, "-") + 1;
|
writepoint = strstr(strrchr(demoname, *PATHSEP), "-") + 1;
|
||||||
demo_slug[128 - (writepoint - demoname) - 4] = 0;
|
demo_slug[128 - (writepoint - demoname) - 4] = 0;
|
||||||
sprintf(writepoint, "%s.lmp", demo_slug);
|
sprintf(writepoint, "%s.lmp", demo_slug);
|
||||||
}
|
}
|
||||||
|
|
@ -3808,7 +3808,7 @@ void G_SaveDemo(void)
|
||||||
md5_buffer((char *)p+16, (demobuffer + length) - (p+16), p);
|
md5_buffer((char *)p+16, (demobuffer + length) - (p+16), p);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (FIL_WriteFile(va(pandf, srb2home, demoname), demobuffer, demo_p - demobuffer)) // finally output the file.
|
if (FIL_WriteFile(demoname, demobuffer, demo_p - demobuffer)) // finally output the file.
|
||||||
demo.savemode = DSM_SAVED;
|
demo.savemode = DSM_SAVED;
|
||||||
free(demobuffer);
|
free(demobuffer);
|
||||||
demo.recording = false;
|
demo.recording = false;
|
||||||
|
|
|
||||||
|
|
@ -3798,12 +3798,14 @@ static void P_InitGametype(void)
|
||||||
//@TODO I'd like to fix dedis crashing when recording replays for the future too...
|
//@TODO I'd like to fix dedis crashing when recording replays for the future too...
|
||||||
if (!demo.playback && multiplayer && !dedicated)
|
if (!demo.playback && multiplayer && !dedicated)
|
||||||
{
|
{
|
||||||
static char buf[256];
|
char buf[MAX_WADPATH];
|
||||||
char *path;
|
int parts;
|
||||||
sprintf(buf, "media"PATHSEP"replay"PATHSEP"online"PATHSEP"%d-%s", (int) (time(NULL)), G_BuildMapName(gamemap));
|
|
||||||
|
|
||||||
path = va("%s"PATHSEP"media"PATHSEP"replay"PATHSEP"online", srb2home);
|
sprintf(buf, "%s"PATHSEP"media"PATHSEP"replay"PATHSEP"online"PATHSEP"%s-%s"PATHSEP"%d-%s",
|
||||||
M_MkdirEach(path, M_PathParts(path) - 4, 0755);
|
srb2home, compbranch, comprevision, (int) (time(NULL)), G_BuildMapName(gamemap));
|
||||||
|
|
||||||
|
parts = M_PathParts(buf);
|
||||||
|
M_MkdirEachUntil(buf, parts - 5, parts - 1, 0755);
|
||||||
|
|
||||||
G_RecordDemo(buf);
|
G_RecordDemo(buf);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue