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
This commit is contained in:
sezero 2010-03-09 14:11:10 +00:00
parent 9eb958f4da
commit 8a4c3ee70c
3 changed files with 4 additions and 5 deletions

View File

@ -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;

View File

@ -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

View File

@ -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 ; i<sv.worldmodel->numsubmodels ; i++)
{