Fixed archiving of CVARs with default values

https://forum.zdoom.org/viewtopic.php?t=59701
This commit is contained in:
alexey.lysiuk 2018-03-06 22:46:18 +02:00
parent 4d4edcfbfb
commit 72831c9db7

View file

@ -1712,7 +1712,10 @@ void C_ArchiveCVars (FConfigFile *f, uint32_t filter)
(CVAR_GLOBALCONFIG|CVAR_ARCHIVE|CVAR_MOD|CVAR_AUTO|CVAR_USERINFO|CVAR_SERVERINFO|CVAR_NOSAVE))
== filter)
{
f->SetValueForKey(cvar->GetName(), cvar->SafeValue);
const char *const value = (cvar->Flags & CVAR_ISDEFAULT)
? cvar->GetGenericRep(CVAR_String).String
: cvar->SafeValue.GetChars();
f->SetValueForKey(cvar->GetName(), value);
}
cvar = cvar->m_Next;
}