From: divverent Date: Sun, 18 Sep 2011 05:46:17 +0000 (+0000) Subject: cvar saving robustness X-Git-Tag: xonotic-v0.6.0~163^2~190 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2d2d1188be78d94770e7f73b5ddf81e168edd90b;p=xonotic%2Fdarkplaces.git cvar saving robustness Don't match cvars that are equal to their default but not locked if they are engine cvars. Fixes config value reverting on "invalid basedir". git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11362 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cvar.c b/cvar.c index 3dee0406..f7cc77bb 100644 --- a/cvar.c +++ b/cvar.c @@ -830,7 +830,7 @@ void Cvar_WriteVariables (qfile_t *f) // don't save cvars that match their default value for (var = cvar_vars ; var ; var = var->next) - if ((var->flags & CVAR_SAVE) && (strcmp(var->string, var->defstring) || !(var->flags & CVAR_DEFAULTSET))) + if ((var->flags & CVAR_SAVE) && (strcmp(var->string, var->defstring) || ((var->flags & CVAR_ALLOCATED) && !(var->flags & CVAR_DEFAULTSET)))) { Cmd_QuoteString(buf1, sizeof(buf1), var->name, "\"\\$", false); Cmd_QuoteString(buf2, sizeof(buf2), var->string, "\"\\$", false);