From 3eb9d8fb5c12df857bf9b2e98efc7509f485d8f3 Mon Sep 17 00:00:00 2001 From: terminx Date: Fri, 11 Mar 2011 21:28:04 +0000 Subject: [PATCH] Addresses http://forums.duke4.net/index.php?s=&showtopic=2961&view=findpost&p=77346 git-svn-id: https://svn.eduke32.com/eduke32@1840 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/demo.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/polymer/eduke32/source/demo.c b/polymer/eduke32/source/demo.c index b81cba178..7a8d9f5b0 100644 --- a/polymer/eduke32/source/demo.c +++ b/polymer/eduke32/source/demo.c @@ -163,16 +163,21 @@ void G_OpenDemoWrite(void) } } - while (1) + do { if (demonum == 10000) return; - Bsprintf(d, "edemo%d.edm", demonum++); - g_demo_filePtr = fopen(d, "rb"); + + if (g_modDir[0] != '/') + Bsprintf(d,"%s/edemo%d.edm",g_modDir, demonum++); + else Bsprintf(d, "edemo%d.edm", demonum++); + + g_demo_filePtr = Bfopen(d, "rb"); if (g_demo_filePtr == NULL) break; Bfclose(g_demo_filePtr); } + while (1); - if ((g_demo_filePtr = fopen(d,"wb")) == NULL) return; + if ((g_demo_filePtr = Bfopen(d,"wb")) == NULL) return; i=sv_saveandmakesnapshot(g_demo_filePtr, demorec_diffs_cvar, demorec_diffcompress_cvar, demorec_synccompress_cvar|(demorec_seeds_cvar<<1));