variable->integer = (int) variable->value;
// link the variable in
- variable->next = cvar_vars;
- cvar_vars = variable;
+// alphanumerical order
+ for( cvar = NULL, cvar2 = cvar_vars ; cvar2 && strcmp( cvar2->name, variable->name ) < 0 ; cvar = cvar2, cvar2 = cvar->next )
+ ;
+ if( cvar ) {
+ cvar->next = variable;
+ } else {
+ cvar_vars = variable;
+ }
+ variable->next = cvar2;
}
/*
if (developer.integer)
Con_Printf("Cvar_Get(\"%s\", \"%s\", %i);\n", name, value, flags);
-
+
// first check to see if it has already been defined
cvar = Cvar_FindVar (name);
if (cvar)
// perform a variable print or set
if (Cmd_Argc() == 1)
{
- // only print if host_initialized (otherwise it could print twice if this is in a script)
- if (host_initialized)
- Con_Printf("\"%s\" is \"%s\"\n", v->name, v->string);
+ Con_Printf("\"%s\" is \"%s\"\n", v->name, v->string);
return true;
}
- if (developer.integer)
- Con_Print("Cvar_Command: ");
+ Con_DPrint("Cvar_Command: ");
if (v->flags & CVAR_READONLY)
{
return;
}
- if (developer.integer)
- Con_Print("Set: ");
+ Con_DPrint("Set: ");
// all looks ok, create/modify the cvar
Cvar_Get(Cmd_Argv(1), Cmd_Argv(2), 0);
return;
}
- if (developer.integer)
- Con_Print("SetA: ");
+ Con_DPrint("SetA: ");
// all looks ok, create/modify the cvar
Cvar_Get(Cmd_Argv(1), Cmd_Argv(2), CVAR_SAVE);