diff --git a/source/src/client.cpp b/source/src/client.cpp index bd265d80..3f38da60 100644 --- a/source/src/client.cpp +++ b/source/src/client.cpp @@ -1045,7 +1045,7 @@ int downloadpackages() bool requirepackage(int type, const char *path) { - if(!havecurl || canceldownloads || !autodownload || type < 0 || type >= PCK_NUM || pendingpackages.access(path)) return false; + if(!havecurl || canceldownloads || type < 0 || type >= PCK_NUM || pendingpackages.access(path)) return false; package *pck = new package; pck->name = unixpath(newstring(path)); diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index d6a0a84c..f0d2bc60 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -1111,7 +1111,10 @@ void showmapstats() } COMMAND(showmapstats, ""); -VARP(showmodedescriptions, 0, 1, 1);extern bool canceldownloads;void startmap(const char *name, bool reset) // called just after a map load +VARP(showmodedescriptions, 0, 1, 1); +extern bool canceldownloads; + +void startmap(const char *name, bool reset) // called just after a map load { canceldownloads = false; copystring(clientmap, name); diff --git a/source/src/protos.h b/source/src/protos.h index ae5b45d1..603f7847 100644 --- a/source/src/protos.h +++ b/source/src/protos.h @@ -327,6 +327,7 @@ static inline Texture *lookupworldtexture(int tex, bool trydl = true) extern float skyfloor; extern void draw_envbox(int fogdist); +extern int autodownload; extern void setupcurl(); extern bool requirepackage(int type, const char *path); extern int downloadpackages(); diff --git a/source/src/texture.cpp b/source/src/texture.cpp index 59630518..4421ea5f 100644 --- a/source/src/texture.cpp +++ b/source/src/texture.cpp @@ -565,12 +565,12 @@ void loadsky(char *basename, bool reload) { defformatstring(name)("packages/%s_%s.jpg", basename, side[i]); sky[i] = textureload(name, 3); - if(sky[i] == notexture && !reload) + if(sky[i] == notexture && !reload && autodownload) { defformatstring(dl)("packages/%s", basename); requirepackage(PCK_SKYBOX, dl); break; - } + } } } diff --git a/source/src/worldio.cpp b/source/src/worldio.cpp index 90c00fb4..fc3e8da4 100644 --- a/source/src/worldio.cpp +++ b/source/src/worldio.cpp @@ -511,19 +511,19 @@ bool load_world(char *mname) // still supports all map formats that have c2skeepalive(); watch.start(); - loopi(256) if(texuse[i]) lookupworldtexture(i, true); + loopi(256) if(texuse[i]) lookupworldtexture(i, autodownload ? true : false); int texloadtime = watch.stop(); c2skeepalive(); watch.start(); - preload_mapmodels(true); + preload_mapmodels(autodownload ? true : false); int mdlloadtime = watch.stop(); c2skeepalive(); watch.start(); - audiomgr.preloadmapsounds(true); + audiomgr.preloadmapsounds(autodownload ? true : false); int audioloadtime = watch.stop(); c2skeepalive();