Browse Source

Implement mp_satchelfix cvar.

halloween
Night Owl 8 years ago
parent
commit
c9ac2c6dab
  1. 4
      dlls/doors.cpp
  2. 2
      dlls/game.cpp
  3. 1
      dlls/game.h
  4. 2
      dlls/player.cpp

4
dlls/doors.cpp

@ -22,6 +22,7 @@
#include "util.h" #include "util.h"
#include "cbase.h" #include "cbase.h"
#include "doors.h" #include "doors.h"
#include "game.h"
#include "weapons.h" #include "weapons.h"
extern void SetMovedir( entvars_t *ev ); extern void SetMovedir( entvars_t *ev );
@ -737,9 +738,12 @@ void CBaseDoor::Blocked( CBaseEntity *pOther )
if( pev->dmg ) if( pev->dmg )
pOther->TakeDamage( pev, pev, pev->dmg, DMG_CRUSH ); pOther->TakeDamage( pev, pev, pev->dmg, DMG_CRUSH );
if( satchelfix.value )
{
// Detonate satchels // Detonate satchels
if( !strcmp( "monster_satchel", STRING( pOther->pev->classname ) ) ) if( !strcmp( "monster_satchel", STRING( pOther->pev->classname ) ) )
( (CSatchel*)pOther )->Use( this, this, USE_ON, 0 ); ( (CSatchel*)pOther )->Use( this, this, USE_ON, 0 );
}
// if a door has a negative wait, it would never come back if blocked, // 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 // so let it just squash the object to death real fast

2
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 falldamage = { "mp_falldamage","0", FCVAR_SERVER };
cvar_t weaponstay = { "mp_weaponstay","0", FCVAR_SERVER }; cvar_t weaponstay = { "mp_weaponstay","0", FCVAR_SERVER };
cvar_t selfgauss = { "mp_selfgauss", "1", 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 forcerespawn = { "mp_forcerespawn","1", FCVAR_SERVER };
cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER }; cvar_t flashlight = { "mp_flashlight","0", FCVAR_SERVER };
cvar_t aimcrosshair = { "mp_autocrosshair","1", FCVAR_SERVER }; cvar_t aimcrosshair = { "mp_autocrosshair","1", FCVAR_SERVER };
@ -469,6 +470,7 @@ void GameDLLInit( void )
CVAR_REGISTER( &falldamage ); CVAR_REGISTER( &falldamage );
CVAR_REGISTER( &weaponstay ); CVAR_REGISTER( &weaponstay );
CVAR_REGISTER( &selfgauss ); CVAR_REGISTER( &selfgauss );
CVAR_REGISTER( &satchelfix );
CVAR_REGISTER( &forcerespawn ); CVAR_REGISTER( &forcerespawn );
CVAR_REGISTER( &flashlight ); CVAR_REGISTER( &flashlight );
CVAR_REGISTER( &aimcrosshair ); CVAR_REGISTER( &aimcrosshair );

1
dlls/game.h

@ -28,6 +28,7 @@ extern cvar_t friendlyfire;
extern cvar_t falldamage; extern cvar_t falldamage;
extern cvar_t weaponstay; extern cvar_t weaponstay;
extern cvar_t selfgauss; extern cvar_t selfgauss;
extern cvar_t satchelfix;
extern cvar_t forcerespawn; extern cvar_t forcerespawn;
extern cvar_t flashlight; extern cvar_t flashlight;
extern cvar_t aimcrosshair; extern cvar_t aimcrosshair;

2
dlls/player.cpp

@ -823,7 +823,9 @@ void CBasePlayer::RemoveAllItems( BOOL removeSuit )
for( i = 0; i < MAX_AMMO_SLOTS; i++ ) for( i = 0; i < MAX_AMMO_SLOTS; i++ )
m_rgAmmo[i] = 0; m_rgAmmo[i] = 0;
if( satchelfix.value )
DeactivateSatchels( this ); DeactivateSatchels( this );
UpdateClientData(); UpdateClientData();
// send Selected Weapon Message to our client // send Selected Weapon Message to our client

Loading…
Cancel
Save