diff --git a/src/engine/baseclientstate.cpp b/src/engine/baseclientstate.cpp index 591f367..f3b3105 100644 --- a/src/engine/baseclientstate.cpp +++ b/src/engine/baseclientstate.cpp @@ -1788,11 +1788,17 @@ bool CBaseClientState::ProcessGetCvarValue( SVC_GetCvarValue *msg ) const ConVar *pVar = g_pCVar->FindVar( msg->m_szCvarName ); if ( pVar ) { + ConVarRef sv_cheats( "sv_cheats" ); if ( pVar->IsFlagSet( FCVAR_SERVER_CANNOT_QUERY ) ) { // The server isn't allowed to query this. returnMsg.m_eStatusCode = eQueryCvarValueStatus_CvarProtected; } + else if ( pVar->IsFlagSet( FCVAR_CHEAT ) && sv_cheats.GetBool() == 0 ) + { + // Return default value if cheats are off and this is a cheat cvar + returnMsg.m_szCvarValue = pVar->GetDefault(); + } else { returnMsg.m_eStatusCode = eQueryCvarValueStatus_ValueIntact; diff --git a/src/engine/cvar.cpp b/src/engine/cvar.cpp index ccb8fc3..2e74807 100644 --- a/src/engine/cvar.cpp +++ b/src/engine/cvar.cpp @@ -397,7 +397,7 @@ bool CCvarUtilities::IsCommand( const CCommand &args ) } // Allow cheat commands in singleplayer, debug, or multiplayer with sv_cheats on - if ( v->IsFlagSet( FCVAR_CHEAT ) ) + if ( v->IsFlagSet( FCVAR_CHEAT ) && false ) { if ( !Host_IsSinglePlayerGame() && !CanCheat() #if !defined(SWDS) @@ -529,7 +529,7 @@ bool CCvarUtilities::IsValidToggleCommand( const char *cmd ) } // Allow cheat commands in singleplayer, debug, or multiplayer with sv_cheats on - if ( v->IsFlagSet( FCVAR_CHEAT ) ) + if ( v->IsFlagSet( FCVAR_CHEAT ) && false ) { if ( !Host_IsSinglePlayerGame() && !CanCheat() #if !defined(SWDS) && !defined(_XBOX)