]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
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 d34378a0c46aad1c053479050761cc54034b5060..119e296d656ca914c3bede8f16261b44c5fcc0fa 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 4fd177d65407b10c421e413cd21ffa7dc1051ab5..2ac7f451c4f3690b1f340a0dbb18fe7d0973c2a4 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 6500b341e23004b0d80bc4f5821ca2ed4c241b21..79c937a492767aa72088748435fe4536a8b49f30 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