mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-12-12 21:22:14 +00:00
Don't let VMs change engine latch cvars immediately
If a VM increases sv_maxclients while a server is running the engine will crash. The value should be latched until engine decides to update the cvar; the same as when a user sets it.
This commit is contained in:
parent
adef4e6c9e
commit
78ca670d4f
1 changed files with 20 additions and 9 deletions
|
@ -638,18 +638,29 @@ Cvar_SetSafe
|
||||||
void Cvar_SetSafe( const char *var_name, const char *value )
|
void Cvar_SetSafe( const char *var_name, const char *value )
|
||||||
{
|
{
|
||||||
int flags = Cvar_Flags( var_name );
|
int flags = Cvar_Flags( var_name );
|
||||||
|
qboolean force = qtrue;
|
||||||
|
|
||||||
if((flags != CVAR_NONEXISTENT) && (flags & CVAR_PROTECTED))
|
if ( flags != CVAR_NONEXISTENT )
|
||||||
{
|
{
|
||||||
if( value )
|
if ( flags & CVAR_PROTECTED )
|
||||||
Com_Error( ERR_DROP, "Restricted source tried to set "
|
{
|
||||||
"\"%s\" to \"%s\"", var_name, value );
|
if( value )
|
||||||
else
|
Com_Error( ERR_DROP, "Restricted source tried to set "
|
||||||
Com_Error( ERR_DROP, "Restricted source tried to "
|
"\"%s\" to \"%s\"", var_name, value );
|
||||||
"modify \"%s\"", var_name );
|
else
|
||||||
return;
|
Com_Error( ERR_DROP, "Restricted source tried to "
|
||||||
|
"modify \"%s\"", var_name );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// don't let VMs or server change engine latched cvars instantly
|
||||||
|
if ( ( flags & CVAR_LATCH ) && !( flags & CVAR_VM_CREATED ) )
|
||||||
|
{
|
||||||
|
force = qfalse;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Cvar_Set( var_name, value );
|
|
||||||
|
Cvar_Set2 (var_name, value, force);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue