From 8a4c3ee70ca1edf7285a373514a3f1ac8f2190a9 Mon Sep 17 00:00:00 2001 From: sezero Date: Tue, 9 Mar 2010 14:11:10 +0000 Subject: [PATCH] Don't explicitly expose pr_strings to the whole engine, make it static to pr_edict.c. Assign a static array of zeroes to sv.model_precache[0] and sv.sound_precache[0], instead of pr_strings, in sv_main.c. git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@109 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/pr_edict.c | 3 +-- Quake/progs.h | 1 - Quake/sv_main.c | 5 +++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Quake/pr_edict.c b/Quake/pr_edict.c index 1a7dc05e..4170c42a 100644 --- a/Quake/pr_edict.c +++ b/Quake/pr_edict.c @@ -31,8 +31,7 @@ globalvars_t *pr_global_struct; float *pr_globals; // same as pr_global_struct int pr_edict_size; // in bytes -char *pr_strings; // no one should access this. not static - // only for two stupid sv_main.c uses. +static char *pr_strings; static int pr_stringssize; static char **pr_knownstrings; static int pr_maxknownstrings; diff --git a/Quake/progs.h b/Quake/progs.h index c49e2f4c..ac7bf095 100644 --- a/Quake/progs.h +++ b/Quake/progs.h @@ -55,7 +55,6 @@ typedef struct edict_s extern dprograms_t *progs; extern dfunction_t *pr_functions; -extern char *pr_strings; extern dstatement_t *pr_statements; extern globalvars_t *pr_global_struct; extern float *pr_globals; // same as pr_global_struct diff --git a/Quake/sv_main.c b/Quake/sv_main.c index ca81cdad..5b15bc81 100644 --- a/Quake/sv_main.c +++ b/Quake/sv_main.c @@ -1274,6 +1274,7 @@ This is called at the start of each level extern float scr_centertime_off; void SV_SpawnServer (char *server) { + static char dummy[4] = { 0, 0, 0, 0 }; edict_t *ent; int i; @@ -1365,8 +1366,8 @@ void SV_SpawnServer (char *server) // SV_ClearWorld (); - sv.sound_precache[0] = pr_strings; - sv.model_precache[0] = pr_strings; + sv.sound_precache[0] = dummy; + sv.model_precache[0] = dummy; sv.model_precache[1] = sv.modelname; for (i=1 ; inumsubmodels ; i++) {