cvar_t *current, *next, *cvar;
char *oldstr;
size_t alloclen;
+ int i;
if (developer_extra.integer)
Con_DPrintf("Cvar_RegisterVariable({\"%s\", \"%s\", %i});\n", variable->name, variable->string, variable->flags);
variable->defstring = cvar->defstring;
variable->value = atof (variable->string);
variable->integer = (int) variable->value;
+ // Preserve autocvar status.
+ memcpy(variable->globaldefindex, cvar->globaldefindex, sizeof(variable->globaldefindex));
+ memcpy(variable->globaldefindex_stringno, cvar->globaldefindex_stringno, sizeof(variable->globaldefindex_stringno));
// replace cvar with this one...
variable->next = cvar->next;
if (cvar_vars == cvar)
variable->value = atof (variable->string);
variable->integer = (int) variable->value;
+ // Mark it as not an autocvar.
+ for (i = 0;i < PRVM_PROG_MAX;i++)
+ variable->globaldefindex[i] = -1;
+
// link the variable in
// alphanumerical order
for( current = NULL, next = cvar_vars ; next && strcmp( next->name, variable->name ) < 0 ; current = next, next = next->next )
{
int hashindex;
cvar_t *current, *next, *cvar;
+ int i;
if (developer_extra.integer)
Con_DPrintf("Cvar_Get(\"%s\", \"%s\", %i);\n", name, value, flags);
else
cvar->description = cvar_dummy_description; // actually checked by VM_cvar_type
+ // Mark it as not an autocvar.
+ for (i = 0;i < PRVM_PROG_MAX;i++)
+ cvar->globaldefindex[i] = -1;
+
// link the variable in
// alphanumerical order
for( current = NULL, next = cvar_vars ; next && strcmp( next->name, cvar->name ) < 0 ; current = next, next = next->next )