don't save cvars that are at their default value
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 7 Jun 2006 06:02:59 +0000 (06:02 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 7 Jun 2006 06:02:59 +0000 (06:02 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6426 d7cf8633-e32d-0410-b094-e92efae38249

cvar.c

diff --git a/cvar.c b/cvar.c
index 68d98df..704f658 100644 (file)
--- a/cvar.c
+++ b/cvar.c
@@ -518,8 +518,9 @@ void Cvar_WriteVariables (qfile_t *f)
 {
        cvar_t  *var;
 
+       // don't save cvars that match their default value
        for (var = cvar_vars ; var ; var = var->next)
-               if (var->flags & CVAR_SAVE)
+               if (var->flags & CVAR_SAVE && strcmp(var->string, var->defstring))
                        FS_Printf(f, "%s%s \"%s\"\n", var->flags & CVAR_ALLOCATED ? "seta " : "", var->name, var->string);
 }