From: Cloudwalk Date: Mon, 31 May 2021 19:37:15 +0000 (-0400) Subject: Merge branch 'master' into doombringer X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fheads%2Fdoombringer;p=xonotic%2Fdarkplaces.git Merge branch 'master' into doombringer --- db26dc984eaec19233ac4cf451ab06f466f21299 diff --cc cl_parse.c index 2703c677,7e228eea..552a7821 --- a/cl_parse.c +++ b/cl_parse.c @@@ -1915,53 -1915,38 +1916,53 @@@ static void CL_ParseServerInfo (void // if cl_autodemo is set, automatically start recording a demo if one isn't being recorded already if (cl_autodemo.integer && cls.netcon && cls.protocol != PROTOCOL_QUAKEWORLD) { - char demofile[MAX_OSPATH]; - + int record_autodemo = false; + if (cls.demorecording) { - // finish the previous level's demo file - CL_Stop_f(cmd_local); + if (cls.demorecording_isauto) + { + // Reki 5-25-21: we only do this if it's an autodemo + // finish the previous level's demo file - CL_Stop_f(cmd_client); ++ CL_Stop_f(cmd_local); + record_autodemo = true; + } + } + else + { + record_autodemo = true; } + + if (record_autodemo) + { + char demofile[MAX_OSPATH]; - // start a new demo file - dpsnprintf (demofile, sizeof(demofile), "%s_%s.dem", Sys_TimeString (cl_autodemo_nameformat.string), cl.worldbasename); + // start a new demo file + dpsnprintf (demofile, sizeof(demofile), "%s_%s.dem", Sys_TimeString (cl_autodemo_nameformat.string), cl.worldbasename); - Con_Printf ("Auto-recording to %s.\n", demofile); + Con_Printf ("Auto-recording to %s.\n", demofile); - // Reset bit 0 for every new demo - Cvar_SetValueQuick(&cl_autodemo_delete, - (cl_autodemo_delete.integer & ~0x1) - | - ((cl_autodemo_delete.integer & 0x2) ? 0x1 : 0) - ); + // Reset bit 0 for every new demo + Cvar_SetValueQuick(&cl_autodemo_delete, + (cl_autodemo_delete.integer & ~0x1) + | + ((cl_autodemo_delete.integer & 0x2) ? 0x1 : 0) + ); - cls.demofile = FS_OpenRealFile(demofile, "wb", false); - if (cls.demofile) - { - cls.forcetrack = -1; - FS_Printf (cls.demofile, "%i\n", cls.forcetrack); - cls.demorecording = true; - strlcpy(cls.demoname, demofile, sizeof(cls.demoname)); - cls.demo_lastcsprogssize = -1; - cls.demo_lastcsprogscrc = -1; + cls.demofile = FS_OpenRealFile(demofile, "wb", false); + if (cls.demofile) + { + cls.forcetrack = -1; + FS_Printf (cls.demofile, "%i\n", cls.forcetrack); + cls.demorecording = true; + cls.demorecording_isauto = true; + strlcpy(cls.demoname, demofile, sizeof(cls.demoname)); + cls.demo_lastcsprogssize = -1; + cls.demo_lastcsprogscrc = -1; + } + else + Con_Print(CON_ERROR "ERROR: couldn't open.\n"); } - else - Con_Print(CON_ERROR "ERROR: couldn't open.\n"); } } cl.islocalgame = NetConn_IsLocalGame(); diff --cc fs.h index a10ca117,b8ada8b9..9ea0945b --- a/fs.h +++ b/fs.h @@@ -85,7 -85,7 +85,8 @@@ void FS_Purge (qfile_t* file) const char *FS_FileWithoutPath (const char *in); const char *FS_FileExtension (const char *in); int FS_CheckNastyPath (const char *path, qbool isgamedir); +int FS_rmtree (const char *path); + void FS_SanitizePath (char *path); extern const char *const fs_checkgamedir_missing; // "(missing)" const char *FS_CheckGameDir(const char *gamedir); // returns NULL if nasty, fs_checkgamedir_missing (exact pointer) if missing