From 6ad90d1388ee03427548282e23fcd5bdba03b83a Mon Sep 17 00:00:00 2001 From: divverent Date: Sun, 7 Feb 2016 01:53:20 +0000 Subject: [PATCH] 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 --- cvar.c | 4 ++-- cvar.h | 1 - prvm_edict.c | 2 -- 3 files changed, 2 insertions(+), 5 deletions(-) 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 -- 2.39.2