]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
quick hack to fix missing PK3s when loading demos with curl downloads (works for...
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 11 Aug 2008 18:23:19 +0000 (18:23 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 11 Aug 2008 18:23:19 +0000 (18:23 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8444 d7cf8633-e32d-0410-b094-e92efae38249

libcurl.c

index 9aa74850bc1961cd45747e18c04b6b9c22f41ca3..e8b9496b97973d4afc99748dac07d71bef83c89b 100644 (file)
--- a/libcurl.c
+++ b/libcurl.c
@@ -619,6 +619,22 @@ void Curl_Begin(const char *URL, const char *name, qboolean ispak, qboolean fort
                length = q ? (size_t)(q - p) : strlen(p);
                dpsnprintf(fn, sizeof(fn), "dlcache/%.*s", (int)length, p);
 
+               if(cls.demorecording)
+               {
+                       void *demobuf; fs_offset_t demofilesize;
+                       char msg[MAX_QPATH + 16];
+                       sizebuf_t sb;
+
+                       sb.data = (void *) msg;
+                       sb.maxsize = sizeof(msg);
+                       SZ_Clear(&sb);
+                       MSG_WriteByte(&sb, svc_stufftext);
+                       MSG_WriteString(&sb, va("\ncurl --pak \"%.*s\"\n", (int)length, p));
+
+                       CL_CutDemo(&demobuf, &demofilesize);
+                       CL_WriteDemoMessage(&sb);
+                       CL_PasteDemo(&demobuf, &demofilesize);
+               }
 
                // already downloading the file?
                {