fix nosave cvar keyword (saved to config, not saved to savegame)

This commit is contained in:
Alexander Kromm 2020-01-06 17:10:38 +07:00 committed by Christoph Oelckers
parent cad14d1c93
commit eeddd72458
3 changed files with 5 additions and 4 deletions

View file

@ -1251,7 +1251,7 @@ FString C_GetMassCVarString (uint32_t filter, bool compact)
{
for (cvar = CVars; cvar != NULL; cvar = cvar->m_Next)
{
if ((cvar->Flags & filter) && !(cvar->Flags & (CVAR_NOSAVE|CVAR_IGNORE)))
if ((cvar->Flags & filter) && !(cvar->Flags & (CVAR_NOSAVE|CVAR_IGNORE|CVAR_NOSAVEGAME)))
{
UCVarValue val = cvar->GetGenericRep(CVAR_String);
dump << '\\' << cvar->GetName() << '\\' << val.String;

View file

@ -60,12 +60,13 @@ enum
CVAR_NOINITCALL = 512, // don't call callback at game start
CVAR_GLOBALCONFIG = 1024, // cvar is saved to global config section
CVAR_VIDEOCONFIG = 2048, // cvar is saved to video config section (not implemented)
CVAR_NOSAVE = 4096, // when used with CVAR_SERVERINFO, do not save var to savegame
CVAR_NOSAVE = 4096, // when used with CVAR_SERVERINFO, do not save var to savegame and config.
CVAR_MOD = 8192, // cvar was defined by a mod
CVAR_IGNORE = 16384,// do not send cvar across the network/inaccesible from ACS (dummy mod cvar)
CVAR_CHEAT = 32768,// can be set only when sv_cheats is enabled
CVAR_UNSAFECONTEXT = 65536,// cvar value came from unsafe context
CVAR_VIRTUAL = 0x20000, //do not invoke the callback recursively so it can be used to mirror an external variable.
CVAR_VIRTUAL = 0x20000, // do not invoke the callback recursively so it can be used to mirror an external variable.
CVAR_NOSAVEGAME = 0x40000, // do not save var to savegame.
};
union UCVarValue

View file

@ -1479,7 +1479,7 @@ void ParseCVarInfo()
}
else if (stricmp(sc.String, "nosave") == 0)
{
cvarflags |= CVAR_NOSAVE;
cvarflags |= CVAR_NOSAVEGAME;
}
else
{