}
Con_DPrintf("execing %s\n",Cmd_Argv(1));
+ // if executing default.cfg for the first time, lock the cvar defaults
+ // it may seem backwards to insert this text BEFORE the default.cfg
+ // but Cbuf_InsertText inserts before, so this actually ends up after it.
+ if (!strcmp(Cmd_Argv(1), "default.cfg"))
+ Cbuf_InsertText("\ncvar_lockdefaults\n");
+
Cbuf_InsertText (f);
Mem_Free(f);
}
{ // Correct Arguments Specified
// Acquire Potential CVar
cvar_t* cvCVar = Cvar_FindVar( Cmd_Argv(1) );
-
+
if(cvCVar != NULL)
{ // Valid CVar
if(nNumArgs == 2)
const char *tempin = in;
COM_ParseTokenConsole( &tempin );
- if ((cvar = Cvar_FindVar(&com_token[0]))) {
+ // don't expand rcon_password or similar cvars (CVAR_PRIVATE flag)
+ if ((cvar = Cvar_FindVar(&com_token[0])) && !(cvar->flags & CVAR_PRIVATE)) {
const char *cvarcontent = cvar->string;
while( *cvarcontent && outlen < maxoutlen ) {
outtext[outlen++] = *cvarcontent++;
Cmd_AddCommand ("cmdlist", Cmd_List_f, "lists all console commands beginning with the specified prefix");
Cmd_AddCommand ("cvarlist", Cvar_List_f, "lists all console variables beginning with the specified prefix");
+ Cmd_AddCommand ("cvar_lockdefaults", Cvar_LockDefaults_f, "stores the current values of all cvars into their default values, only used once during startup after parsing default.cfg");
+ Cmd_AddCommand ("cvar_resettodefaults_all", Cvar_ResetToDefaults_All_f, "sets all cvars to their locked default values");
+ Cmd_AddCommand ("cvar_resettodefaults_nosaveonly", Cvar_ResetToDefaults_NoSaveOnly_f, "sets all non-saved cvars to their locked default values (variables that will not be saved to config.cfg)");
+ Cmd_AddCommand ("cvar_resettodefaults_saveonly", Cvar_ResetToDefaults_SaveOnly_f, "sets all saved cvars to their locked default values (variables that will be saved to config.cfg)");
+
// DRESK - 5/14/06
// Support Doom3-style Toggle Command
Cmd_AddCommand( "toggle", Cmd_Toggle_f, "toggles a console variable's values (use for more info)");