FBaseCVar *cvar_set (const char *var_name, const char *val) { FBaseCVar *var; if ( (var = FindCVar (var_name, NULL)) ) { UCVarValue value; value.String = const_cast<char *>(val); var->SetGenericRep (value, CVAR_String); } return var; }
void C_SetCVarsToDefaults (void) { FBaseCVar *cvar = CVars; while (cvar) { // Only default save-able cvars if (cvar->Flags & CVAR_ARCHIVE) { UCVarValue val; ECVarType type; val = cvar->GetFavoriteRepDefault (&type); cvar->SetGenericRep (val, type); } cvar = cvar->m_Next; } }
void FGameConfigFile::ReadCVars (DWORD flags) { const char *key, *value; FBaseCVar *cvar; UCVarValue val; while (NextInSection (key, value)) { cvar = FindCVar (key, NULL); if (cvar == NULL) { cvar = new FStringCVar (key, NULL, CVAR_AUTO|CVAR_UNSETTABLE|CVAR_ARCHIVE|flags); } val.String = const_cast<char *>(value); cvar->SetGenericRep (val, CVAR_String); } }