]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_demo.c
Add QC/cfg facilities to control deletion of automatically recorded demos
[xonotic/darkplaces.git] / cl_demo.c
index 08f84745425d26fcecda08795abe157d892298bf..7b678b7f0d22d925b203ddd9f41e39278bed0af7 100644 (file)
--- a/cl_demo.c
+++ b/cl_demo.c
@@ -306,10 +306,16 @@ void CL_Stop_f (void)
        CL_WriteDemoMessage(&buf);
 
 // finish up
+       if (cl_autodemo.integer && ((cl_autodemo_delete.integer & 1) ^ ((cl_autodemo_delete.integer >> 1) & 1))) // bit 0 XOR bit 1
+       {
+               FS_RemoveOnClose(cls.demofile);
+               Con_Print("Completed and deleted demo\n");
+       }
+       else
+               Con_Print("Completed demo\n");
        FS_Close (cls.demofile);
        cls.demofile = NULL;
        cls.demorecording = false;
-       Con_Print("Completed demo\n");
 }
 
 /*