From 32adfdae00df5e0c98aca4ac10d4755117327004 Mon Sep 17 00:00:00 2001 From: Kyle Spier-Swenson Date: Mon, 15 Jan 2018 07:32:20 -0800 Subject: [PATCH] Fixes compiler errors in the preload_rsc external resource thingy (#34061) Fixes compiler errors in the preload_rsc external resource thingy --- code/_compile_options.dm | 10 +++++----- code/game/world.dm | 8 ++++---- code/modules/client/client_procs.dm | 15 +++++++-------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/code/_compile_options.dm b/code/_compile_options.dm index 9fd5f1cbf1..c0985281c5 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -13,11 +13,11 @@ //#define VISUALIZE_ACTIVE_TURFS //Highlights atmos active turfs in green #endif -#define PRELOAD_RSC 1 /*set to: - 0 to allow using external resources or on-demand behaviour; - 1 to use the default behaviour; - 2 for preloading absolutely everything; - */ +#ifndef PRELOAD_RSC //set to: +#define PRELOAD_RSC 0 // 0 to allow using external resources or on-demand behaviour; +#endif // 1 to use the default behaviour; + // 2 for preloading absolutely everything; + #define BACKGROUND_ENABLED 0 // The default value for all uses of set background. Set background can cause gradual lag and is recommended you only turn this on if necessary. // 1 will enable set background. 0 will disable set background. diff --git a/code/game/world.dm b/code/game/world.dm index b1174b3386..ab5f3ea934 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -45,13 +45,13 @@ GLOBAL_PROTECT(security_mode) /world/proc/SetupExternalRSC() #if (PRELOAD_RSC == 0) - external_rsc_urls = world.file2list("config/external_rsc_urls.txt","\n") + GLOB.external_rsc_urls = world.file2list("config/external_rsc_urls.txt","\n") var/i=1 - while(i<=external_rsc_urls.len) - if(external_rsc_urls[i]) + while(i<=GLOB.external_rsc_urls.len) + if(GLOB.external_rsc_urls[i]) i++ else - external_rsc_urls.Cut(i,i+1) + GLOB.external_rsc_urls.Cut(i,i+1) #endif /world/proc/CheckSchemaVersion() diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index fd4581507b..298091ef59 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -138,7 +138,7 @@ //CONNECT// /////////// #if (PRELOAD_RSC == 0) -GLOBAL_LIST(external_rsc_urls) +GLOBAL_LIST_EMPTY(external_rsc_urls) #endif @@ -150,13 +150,6 @@ GLOBAL_LIST(external_rsc_urls) if(connection != "seeker" && connection != "web")//Invalid connection type. return null -#if (PRELOAD_RSC == 0) - var/static/next_external_rsc = 0 - if(external_rsc_urls && external_rsc_urls.len) - next_external_rsc = WRAP(next_external_rsc+1, 1, external_rsc_urls.len+1) - preload_rsc = external_rsc_urls[next_external_rsc] -#endif - GLOB.clients += src GLOB.directory[ckey] = src @@ -654,6 +647,12 @@ GLOBAL_LIST(external_rsc_urls) //send resources to the client. It's here in its own proc so we can move it around easiliy if need be /client/proc/send_resources() +#if (PRELOAD_RSC == 0) + var/static/next_external_rsc = 0 + if(GLOB.external_rsc_urls && GLOB.external_rsc_urls.len) + next_external_rsc = WRAP(next_external_rsc+1, 1, GLOB.external_rsc_urls.len+1) + preload_rsc = GLOB.external_rsc_urls[next_external_rsc] +#endif //get the common files getFiles( 'html/search.js',