diff --git a/dlls/client.cpp b/dlls/client.cpp index 142b5de8..82b8e7e7 100644 --- a/dlls/client.cpp +++ b/dlls/client.cpp @@ -468,7 +468,7 @@ ClientCommand called each time a player uses a "cmd" command ============ */ -extern float g_flWeaponCheat; +extern cvar_t *g_enable_cheats; // Use CMD_ARGV, CMD_ARGV, and CMD_ARGC to get pointers the character string command. void ClientCommand( edict_t *pEntity ) @@ -496,7 +496,7 @@ void ClientCommand( edict_t *pEntity ) } else if( FStrEq(pcmd, "give" ) ) { - if( g_flWeaponCheat != 0.0f ) + if( g_enable_cheats->value != 0 ) { int iszItem = ALLOC_STRING( CMD_ARGV( 1 ) ); // Make a copy of the classname GetClassPtr( (CBasePlayer *)pev )->GiveNamedItem( STRING( iszItem ) ); @@ -504,7 +504,7 @@ void ClientCommand( edict_t *pEntity ) } else if( FStrEq( pcmd, "fire" ) ) { - if( g_flWeaponCheat != 0.0f ) + if( g_enable_cheats->value != 0 ) { CBaseEntity *pPlayer = CBaseEntity::Instance( pEntity ); if( CMD_ARGC() > 1 ) @@ -540,7 +540,7 @@ void ClientCommand( edict_t *pEntity ) } else if( FStrEq( pcmd, "fov" ) ) { - if( g_flWeaponCheat && CMD_ARGC() > 1 ) + if( g_enable_cheats->value != 0 && CMD_ARGC() > 1 ) { GetClassPtr( (CBasePlayer *)pev )->m_iFOV = atoi( CMD_ARGV( 1 ) ); } diff --git a/dlls/game.cpp b/dlls/game.cpp index 1207a089..eb4ae16b 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -55,6 +55,7 @@ cvar_t mp_chattime = { "mp_chattime","10", FCVAR_SERVER }; cvar_t *g_psv_gravity = NULL; cvar_t *g_psv_aim = NULL; cvar_t *g_footsteps = NULL; +cvar_t *g_enable_cheats = NULL; cvar_t *g_psv_developer; @@ -467,6 +468,8 @@ void GameDLLInit( void ) g_psv_developer = CVAR_GET_POINTER( "developer" ); + g_enable_cheats = CVAR_GET_POINTER( "sv_cheats" ); + CVAR_REGISTER( &displaysoundlist ); CVAR_REGISTER( &allow_spectators ); @@ -497,6 +500,8 @@ void GameDLLInit( void ) CVAR_REGISTER( &mp_chattime ); + + // REGISTER CVARS FOR SKILL LEVEL STUFF // Agrunt CVAR_REGISTER( &sk_agrunt_health1 );// {"sk_agrunt_health1","0"}; diff --git a/dlls/game.h b/dlls/game.h index 77502e76..3119351a 100644 --- a/dlls/game.h +++ b/dlls/game.h @@ -44,6 +44,7 @@ extern cvar_t allowmonsters; extern cvar_t *g_psv_gravity; extern cvar_t *g_psv_aim; extern cvar_t *g_footsteps; +extern cvar_t *g_enable_cheats; extern cvar_t *g_psv_developer; #endif // GAME_H diff --git a/dlls/player.cpp b/dlls/player.cpp index 002635c0..cce57d02 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -3355,7 +3355,7 @@ void CBasePlayer::ForceClientDllUpdate( void ) ImpulseCommands ============ */ -extern float g_flWeaponCheat; +extern cvar_t *g_enable_cheats; void CBasePlayer::ImpulseCommands() { @@ -3434,7 +3434,7 @@ void CBasePlayer::ImpulseCommands() void CBasePlayer::CheatImpulseCommands( int iImpulse ) { #if !HLDEMO_BUILD - if( g_flWeaponCheat == 0.0f ) + if( g_enable_cheats->value == 0 ) { return; } diff --git a/dlls/world.cpp b/dlls/world.cpp index 0d7db511..3f4bda0b 100644 --- a/dlls/world.cpp +++ b/dlls/world.cpp @@ -449,7 +449,6 @@ LINK_ENTITY_TO_CLASS( worldspawn, CWorld ) #define SF_WORLD_FORCETEAM 0x0004 // Force teams extern DLL_GLOBAL BOOL g_fGameOver; -float g_flWeaponCheat; void CWorld::Spawn( void ) { @@ -652,9 +651,6 @@ void CWorld::Precache( void ) { CVAR_SET_FLOAT( "mp_defaultteam", 0.0f ); } - - // g-cont. moved here so cheats will working on restore level - g_flWeaponCheat = CVAR_GET_FLOAT( "sv_cheats" ); // Is the impulse 101 command allowed? } //