]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_parse.c
use -MMD instead of -MD for making dependencies, this skips system
[xonotic/darkplaces.git] / cl_parse.c
index bbef89ce48d0ed25865d1a5dc79b0e1bb45730f3..6b7c258510985fe7617a5de6914dae1ea57f8cac 100644 (file)
@@ -369,6 +369,9 @@ void CL_ParseEntityLump(char *entdata)
                        r_refdef.fog_start = 0;
                        r_refdef.fog_alpha = 1;
                        r_refdef.fog_end = 16384;
+#if _MSC_VER >= 1400
+#define sscanf sscanf_s
+#endif
                        sscanf(value, "%f %f %f %f %f %f %f", &r_refdef.fog_density, &r_refdef.fog_red, &r_refdef.fog_green, &r_refdef.fog_blue, &r_refdef.fog_alpha, &r_refdef.fog_start, &r_refdef.fog_end);
                }
                else if (!strcmp("fog_density", key))
@@ -1040,6 +1043,16 @@ void CL_BeginDownloads(qboolean aborteddownload)
                // finished loading sounds
        }
 
+       if(gamemode == GAME_NEXUIZ)
+               goto skipdownloads;
+               // in Nexuiz, the built in download protocol is kinda broken (misses lots
+               // of dependencies) anyway, and can mess around with the game directory;
+               // until this is fixed, only support pk3 downloads via curl, and turn off
+               // individual file downloads other than for CSQC
+               // on the other end of the download protocol, GAME_NEXUIZ enforces writing
+               // to dlcache only
+               // idea: support download of pk3 files using this protocol later
+
        // note: the reason these loops skip already-loaded things is that it
        // enables this command to be issued during the game if desired
 
@@ -1136,6 +1149,7 @@ void CL_BeginDownloads(qboolean aborteddownload)
                // finished loading sounds
        }
 
+skipdownloads:
        if (!cl.loadfinished)
        {
                cl.loadfinished = true;
@@ -1171,7 +1185,8 @@ void CL_StopDownload(int size, int crc)
                // save to disk only if we don't already have it
                // (this is mainly for playing back demos)
                existingcrc = FS_CRCFile(cls.qw_downloadname, &existingsize);
-               if (existingsize)
+               if (existingsize || gamemode == GAME_NEXUIZ || !strcmp(cls.qw_downloadname, csqc_progname.string))
+                       // let csprogs ALWAYS go to dlcache, to prevent "viral csprogs"; also, never put files outside dlcache for Nexuiz
                {
                        if ((int)existingsize != size || existingcrc != crc)
                        {