From eeddd724587c10c9d2b3997c5a4dba4d99e72155 Mon Sep 17 00:00:00 2001 From: Alexander Kromm Date: Mon, 6 Jan 2020 17:10:38 +0700 Subject: [PATCH] fix nosave cvar keyword (saved to config, not saved to savegame) --- src/console/c_cvars.cpp | 2 +- src/console/c_cvars.h | 5 +++-- src/d_main.cpp | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/console/c_cvars.cpp b/src/console/c_cvars.cpp index 4b0383921..be034dc07 100644 --- a/src/console/c_cvars.cpp +++ b/src/console/c_cvars.cpp @@ -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; diff --git a/src/console/c_cvars.h b/src/console/c_cvars.h index 6d43f1667..dc498ebb8 100644 --- a/src/console/c_cvars.h +++ b/src/console/c_cvars.h @@ -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 diff --git a/src/d_main.cpp b/src/d_main.cpp index 3f01aa618..de652a9c2 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1479,7 +1479,7 @@ void ParseCVarInfo() } else if (stricmp(sc.String, "nosave") == 0) { - cvarflags |= CVAR_NOSAVE; + cvarflags |= CVAR_NOSAVEGAME; } else {