engine: reset cheat cvars on remote games

This commit is contained in:
Alibek Omarov 2022-12-01 02:44:01 +03:00
parent 9cbf5ab6a6
commit d9a245dcb5
3 changed files with 7 additions and 0 deletions

View File

@ -1051,6 +1051,9 @@ void CL_SendConnectPacket( void )
input_devices = IN_CollectInputDevices();
IN_LockInputDevices( true );
Cvar_SetCheatState();
Cvar_FullSet( "sv_cheats", "0", FCVAR_READ_ONLY | FCVAR_SERVER );
Info_SetValueForKey( protinfo, "d", va( "%d", input_devices ), sizeof( protinfo ) );
Info_SetValueForKey( protinfo, "v", XASH_VERSION, sizeof( protinfo ) );
Info_SetValueForKey( protinfo, "b", va( "%d", Q_buildnum() ), sizeof( protinfo ) );

View File

@ -441,6 +441,7 @@ extern convar_t deathmatch;
extern convar_t hostname;
extern convar_t skill;
extern convar_t coop;
extern convar_t sv_cheats;
extern convar_t *sv_pausable; // allows pause in multiplayer
extern convar_t *sv_check_errors;

View File

@ -877,6 +877,9 @@ qboolean SV_SpawnServer( const char *mapname, const char *startspot, qboolean ba
if( !SV_InitGame( ))
return false;
// unlock sv_cheats in local game
ClearBits( sv_cheats.flags, FCVAR_READ_ONLY );
svs.initialized = true;
Log_Open();
Log_Printf( "Loading map \"%s\"\n", mapname );