make nosave standalone CVar flag, alongside server and user
This commit is contained in:
parent
f85e3fb9a0
commit
7973ab9c6b
4 changed files with 47 additions and 35 deletions
|
|
@ -1479,7 +1479,7 @@ void ParseCVarInfo()
|
|||
}
|
||||
else if (stricmp(sc.String, "nosave") == 0)
|
||||
{
|
||||
cvarflags |= CVAR_NOSAVEGAME;
|
||||
cvarflags |= CVAR_CONFIG_ONLY;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1487,11 +1487,22 @@ void ParseCVarInfo()
|
|||
}
|
||||
sc.MustGetAnyToken();
|
||||
}
|
||||
|
||||
// Possibility of defining a cvar as 'server nosave' or 'user nosave' is kept for
|
||||
// compatibility reasons.
|
||||
if (cvarflags & CVAR_CONFIG_ONLY)
|
||||
{
|
||||
cvarflags &= ~CVAR_SERVERINFO;
|
||||
cvarflags &= ~CVAR_USERINFO;
|
||||
}
|
||||
|
||||
// Do some sanity checks.
|
||||
if ((cvarflags & (CVAR_SERVERINFO|CVAR_USERINFO)) == 0 ||
|
||||
// No need to check server-nosave and user-nosave combinations because they
|
||||
// are made impossible right above.
|
||||
if ((cvarflags & (CVAR_SERVERINFO|CVAR_USERINFO|CVAR_CONFIG_ONLY)) == 0 ||
|
||||
(cvarflags & (CVAR_SERVERINFO|CVAR_USERINFO)) == (CVAR_SERVERINFO|CVAR_USERINFO))
|
||||
{
|
||||
sc.ScriptError("One of 'server' or 'user' must be specified");
|
||||
sc.ScriptError("One of 'server', 'user', or 'nosave' must be specified");
|
||||
}
|
||||
// The next token must be the cvar type.
|
||||
if (sc.TokenType == TK_Bool)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue