Removed globaldefindex_progid field from cvar struct.
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 7 Feb 2016 01:53:20 +0000 (01:53 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 7 Feb 2016 01:53:20 +0000 (01:53 +0000)
From: Grigorii Kasymov <kasymovga@xsmail.com>

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12243 d7cf8633-e32d-0410-b094-e92efae38249

cvar.c
cvar.h
prvm_edict.c

diff --git a/cvar.c b/cvar.c
index d34378a..119e296 100644 (file)
--- 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 4fd177d..2ac7f45 100644 (file)
--- 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];
 
index 6500b34..79c937a 100644 (file)
@@ -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