[cvar] Preserve cvars loaded from config files

This restores the equivalent functionality that seta in config.cfg
provided (no more losing my volume setting after using -nosound).
This commit is contained in:
Bill Currie 2021-12-15 07:25:03 +09:00
parent e0497c7fff
commit 9d4017885f

View file

@ -380,6 +380,10 @@ Cvar_LoadConfig (plitem_t *config)
cvar_t *var = Cvar_FindVar (cvar_name);
if (var) {
Cvar_Set (var, value);
Cvar_SetFlags (var, var->flags | CVAR_ARCHIVE);
} else {
Cvar_Get (cvar_name, value, CVAR_USER_CREATED | CVAR_ARCHIVE,
0, USER_CVAR);
}
}
}