if (developer_extra.integer)
Con_DPrintf("Cvar_RegisterVariable({\"%s\", \"%s\", %i});\n", variable->name, variable->string, variable->flags);
-// first check to see if it has already been defined
+ // first check to see if it has already been defined
cvar = Cvar_FindVar(cvars, variable->name, ~0);
if (cvar)
{
return;
}
-// check for overlap with a command
+ // check for overlap with a command
if (Cmd_Exists(&cmd_client, variable->name) || Cmd_Exists(&cmd_server, variable->name))
{
Con_Printf("Cvar_RegisterVariable: %s is a command\n", variable->name);
return;
}
-// copy the value off, because future sets will Z_Free it
+ // copy the value off, because future sets will Z_Free it
oldstr = (char *)variable->string;
alloclen = strlen(variable->string) + 1;
variable->string = (char *)Z_Malloc (alloclen);
if (developer_extra.integer)
Con_DPrintf("Cvar_Get(\"%s\", \"%s\", %i);\n", name, value, flags);
-// first check to see if it has already been defined
+ // first check to see if it has already been defined
cvar = Cvar_FindVar(cvars, name, ~0);
if (cvar)
{
return cvar;
}
-// check for pure evil
+ // check for pure evil
if (!*name)
{
Con_Printf("Cvar_Get: invalid variable name\n");
return NULL;
}
-// check for overlap with a command
+ // check for overlap with a command
if (Cmd_Exists(&cmd_client, name) || Cmd_Exists(&cmd_server, name))
{
Con_Printf("Cvar_Get: %s is a command\n", name);
return NULL;
}
-// allocate a new cvar, cvar name, and cvar string
-// TODO: factorize the following code with the one at the end of Cvar_RegisterVariable()
-// FIXME: these never get Z_Free'd
+ // allocate a new cvar, cvar name, and cvar string
+ // TODO: factorize the following code with the one at the end of Cvar_RegisterVariable()
+ // FIXME: these never get Z_Free'd
cvar = (cvar_t *)Z_Malloc(sizeof(cvar_t));
cvar->flags = flags | CF_ALLOCATED;
cvar->name = (char *)Mem_strdup(zonemempool, name);
cvar_state_t *cvars = cmd->cvars;
cvar_t *v;
-// check variables
+ // check variables
v = Cvar_FindVar(cvars, Cmd_Argv(cmd, 0), (cmd->cvars_flagsmask));
if (!v)
return false;
-// perform a variable print or set
+ // perform a variable print or set
if (Cmd_Argc(cmd) == 1)
{
Cvar_PrintHelp(v, Cmd_Argv(cmd, 0), true);
if (developer_extra.integer)
Con_DPrint("Cvar_Command: ");
-
+
if(Cvar_Readonly(v, NULL))
return true;
-
+
Cvar_SetQuick(v, Cmd_Argv(cmd, 1));
if (developer_extra.integer)
Con_DPrint("\n");
return true;
}
-
void Cvar_UnlockDefaults(cmd_state_t *cmd)
{
cvar_state_t *cvars = cmd->cvars;
var->flags &= ~CF_DEFAULTSET;
}
-
void Cvar_LockDefaults_f(cmd_state_t *cmd)
{
cvar_state_t *cvars = cmd->cvars;
}
}
-
void Cvar_ResetToDefaults_NoSaveOnly_f(cmd_state_t *cmd)
{
cvar_state_t *cvars = cmd->cvars;
}
}
-
/*
============
Cvar_WriteVariables
}
}
-
// Added by EvilTypeGuy eviltypeguy@qeradiant.com
// 2000-01-09 CvarList command By Matthias "Maddes" Buecher, http://www.inside3d.com/qip/
/*