From: divverent Date: Sun, 7 Feb 2016 01:53:20 +0000 (+0000) Subject: Removed globaldefindex_progid field from cvar struct. X-Git-Tag: xonotic-v0.8.2~55 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e7ab27e01b55012196f6326d41c6772cbbaaad21;p=xonotic%2Fdarkplaces.git Removed globaldefindex_progid field from cvar struct. From: Grigorii Kasymov git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12243 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=6ad90d1388ee03427548282e23fcd5bdba03b83a --- diff --git a/cvar.c b/cvar.c index d34378a0..119e296d 100644 --- a/cvar.c +++ b/cvar.c @@ -270,7 +270,7 @@ static qboolean Cvar_IsAutoCvar(cvar_t *var) for (i = 0;i < PRVM_PROG_MAX;i++) { prog = &prvm_prog_list[i]; - if (prog->loaded && var->globaldefindex_progid[i] == prog->id && var->globaldefindex[i] >= 0) + if (prog->loaded && var->globaldefindex[i] >= 0) return true; } return false; @@ -287,7 +287,7 @@ static void Cvar_UpdateAutoCvar(cvar_t *var) for (i = 0;i < PRVM_PROG_MAX;i++) { prog = &prvm_prog_list[i]; - if (prog->loaded && var->globaldefindex_progid[i] == prog->id && var->globaldefindex[i] >= 0) + if (prog->loaded && var->globaldefindex[i] >= 0) { // MUST BE SYNCED WITH prvm_edict.c PRVM_LoadProgs switch(prog->globaldefs[var->globaldefindex[i]].type & ~DEF_SAVEGLOBAL) diff --git a/cvar.h b/cvar.h index 4fd177d6..2ac7f451 100644 --- a/cvar.h +++ b/cvar.h @@ -134,7 +134,6 @@ typedef struct cvar_s float initvector[3]; const char *initdefstring; - unsigned int globaldefindex_progid[3]; int globaldefindex[3]; int globaldefindex_stringno[3]; diff --git a/prvm_edict.c b/prvm_edict.c index 6500b341..79c937a4 100644 --- a/prvm_edict.c +++ b/prvm_edict.c @@ -2402,7 +2402,6 @@ void PRVM_Prog_Load(prvm_prog_t *prog, const char * filename, unsigned char * da } if(!cvar) prog->error_cmd("PRVM_LoadProgs: could not create cvar for autocvar global %s in %s", name, prog->name); - cvar->globaldefindex_progid[prog - prvm_prog_list] = prog->id; cvar->globaldefindex[prog - prvm_prog_list] = i; } else if((cvar->flags & CVAR_PRIVATE) == 0) @@ -2439,7 +2438,6 @@ void PRVM_Prog_Load(prvm_prog_t *prog, const char * filename, unsigned char * da Con_Printf("PRVM_LoadProgs: invalid type of autocvar global %s in %s\n", name, prog->name); goto fail; } - cvar->globaldefindex_progid[prog - prvm_prog_list] = prog->id; cvar->globaldefindex[prog - prvm_prog_list] = i; } else