From c9ac2c6dabf511a5b68526876d47a8579c2bf02c Mon Sep 17 00:00:00 2001 From: Night Owl Date: Thu, 20 Jul 2017 12:22:02 +0500 Subject: [PATCH] Implement mp_satchelfix cvar. --- dlls/doors.cpp | 10 +++++++--- dlls/game.cpp | 2 ++ dlls/game.h | 1 + dlls/player.cpp | 4 +++- 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/dlls/doors.cpp b/dlls/doors.cpp index ce901ee8..61a04ed2 100644 --- a/dlls/doors.cpp +++ b/dlls/doors.cpp @@ -22,6 +22,7 @@ #include "util.h" #include "cbase.h" #include "doors.h" +#include "game.h" #include "weapons.h" extern void SetMovedir( entvars_t *ev ); @@ -737,9 +738,12 @@ void CBaseDoor::Blocked( CBaseEntity *pOther ) if( pev->dmg ) pOther->TakeDamage( pev, pev, pev->dmg, DMG_CRUSH ); - // Detonate satchels - if( !strcmp( "monster_satchel", STRING( pOther->pev->classname ) ) ) - ( (CSatchel*)pOther )->Use( this, this, USE_ON, 0 ); + if( satchelfix.value ) + { + // Detonate satchels + if( !strcmp( "monster_satchel", STRING( pOther->pev->classname ) ) ) + ( (CSatchel*)pOther )->Use( this, this, USE_ON, 0 ); + } // if a door has a negative wait, it would never come back if blocked, // so let it just squash the object to death real fast diff --git a/dlls/game.cpp b/dlls/game.cpp index b109f376..4354a63d 100644 --- a/dlls/game.cpp +++ b/dlls/game.cpp @@ -31,6 +31,7 @@ cvar_t friendlyfire = { "mp_friendlyfire","0", FCVAR_SERVER }; cvar_t falldamage = { "mp_falldamage","0", FCVAR_SERVER }; cvar_t weaponstay = { "mp_weaponstay","0", FCVAR_SERVER }; cvar_t selfgauss = { "mp_selfgauss", "1", FCVAR_SERVER }; +cvar_t satchelfix = { "mp_satchelfix", "0", FCVAR_SERVER }; cvar_t forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER }; cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER }; cvar_t aimcrosshair = { "mp_autocrosshair","1", FCVAR_SERVER }; @@ -469,6 +470,7 @@ void GameDLLInit( void ) CVAR_REGISTER( &falldamage ); CVAR_REGISTER( &weaponstay ); CVAR_REGISTER( &selfgauss ); + CVAR_REGISTER( &satchelfix ); CVAR_REGISTER( &forcerespawn ); CVAR_REGISTER( &flashlight ); CVAR_REGISTER( &aimcrosshair ); diff --git a/dlls/game.h b/dlls/game.h index e29b2563..a6d0cd1c 100644 --- a/dlls/game.h +++ b/dlls/game.h @@ -28,6 +28,7 @@ extern cvar_t friendlyfire; extern cvar_t falldamage; extern cvar_t weaponstay; extern cvar_t selfgauss; +extern cvar_t satchelfix; extern cvar_t forcerespawn; extern cvar_t flashlight; extern cvar_t aimcrosshair; diff --git a/dlls/player.cpp b/dlls/player.cpp index 0d86caf8..1a7bc206 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -823,7 +823,9 @@ void CBasePlayer::RemoveAllItems( BOOL removeSuit ) for( i = 0; i < MAX_AMMO_SLOTS; i++ ) m_rgAmmo[i] = 0; - DeactivateSatchels( this ); + if( satchelfix.value ) + DeactivateSatchels( this ); + UpdateClientData(); // send Selected Weapon Message to our client