Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions cl_dll/hud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ extern client_sprite_t *GetSpriteList(client_sprite_t *pList, const char *psz, i
extern float IN_GetMouseSensitivity();

cvar_t *cl_lw = NULL;
cvar_t *legacy_satchel = NULL;

void ShutdownInput (void);

Expand Down Expand Up @@ -329,6 +330,7 @@ void CHud :: Init( void )

CVAR_CREATE( "zoom_sensitivity_ratio", "1.2", FCVAR_ARCHIVE );
CVAR_CREATE( "cl_autowepswitch", "1", FCVAR_USERINFO|FCVAR_ARCHIVE );
legacy_satchel = CVAR_CREATE( "cl_legacy_satchel", "0", FCVAR_USERINFO | FCVAR_ARCHIVE );
default_fov = CVAR_CREATE( "default_fov", "90", FCVAR_ARCHIVE );
m_pCvarStealMouse = CVAR_CREATE( "hud_capturemouse", "1", FCVAR_ARCHIVE );
m_pCvarDraw = CVAR_CREATE( "hud_draw", "1", FCVAR_ARCHIVE );
Expand Down
4 changes: 4 additions & 0 deletions dlls/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,8 @@ cvar_t sv_pushable_fixed_tick_fudge = { "sv_pushable_fixed_tick_fudge", "15" };

cvar_t sv_busters = { "sv_busters", "0" };

cvar_t legacy_hgrenade = { "sv_legacy_hgrenade", "0", FCVAR_SERVER };

// Register your console variables here
// This gets called one time when the game is initialied
void GameDLLInit( void )
Expand Down Expand Up @@ -895,6 +897,8 @@ void GameDLLInit( void )

CVAR_REGISTER ( &sv_pushable_fixed_tick_fudge );

CVAR_REGISTER ( &legacy_hgrenade );

SERVER_COMMAND( "exec skill.cfg\n" );
}

3 changes: 3 additions & 0 deletions dlls/gamerules.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ class CHalfLifeRules : public CGameRules
// Teamplay stuff
virtual const char *GetTeamID( CBaseEntity *pEntity ) {return "";};
virtual int PlayerRelationship( CBaseEntity *pPlayer, CBaseEntity *pTarget );

// Client preference
virtual void ClientUserInfoChanged( CBasePlayer *pPlayer, char *infobuffer );
};

//=========================================================
Expand Down
17 changes: 14 additions & 3 deletions dlls/handgrenade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,21 @@ void CHandGrenade::WeaponIdle( void )
else
angThrow.x = -10 + angThrow.x * ( ( 90 + 10 ) / 90.0 );

static float flMultiplier = 6.5f;
float flMultiplier = 6.5f;
float flMaxVel = 1000.0f;

#ifndef CLIENT_DLL
extern cvar_t legacy_hgrenade;
if ( legacy_hgrenade.value > 0 )
{
flMultiplier = 4.0f;
flMaxVel = 500.0f;
}
#endif

float flVel = ( 90 - angThrow.x ) * flMultiplier;
if ( flVel > 1000 )
flVel = 1000;
if ( flVel > flMaxVel )
flVel = flMaxVel;

UTIL_MakeVectors( angThrow );

Expand Down
11 changes: 11 additions & 0 deletions dlls/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4348,6 +4348,17 @@ void CBasePlayer :: SetPrefsFromUserinfo( char * infobuffer )
{
m_iAutoWepSwitch = atoi( pszKeyVal );
}

// Set satchel charge control preference
pszKeyVal = g_engfuncs.pfnInfoKeyValue( infobuffer, "cl_legacy_satchel" );
if ( FStrEq( pszKeyVal, "" ) )
{
m_iLegacySatchel = 0;
}
else
{
m_iLegacySatchel = atoi( pszKeyVal );
}
}


Expand Down
1 change: 1 addition & 0 deletions dlls/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ class CBasePlayer : public CBaseMonster
float m_flNextChatTime;

int m_iAutoWepSwitch;
int m_iLegacySatchel;
};

#define AUTOAIM_2DEGREES 0.0348994967025
Expand Down
46 changes: 41 additions & 5 deletions dlls/satchel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
#include "player.h"
#include "gamerules.h"

#ifdef CLIENT_DLL
extern cvar_t *legacy_satchel;
#endif

enum satchel_e {
SATCHEL_IDLE1 = 0,
SATCHEL_FIDGET1,
Expand Down Expand Up @@ -350,15 +354,47 @@ void CSatchel::Holster( int skiplocal /* = 0 */ )

void CSatchel::PrimaryAttack()
{
// we're reloading, don't allow fire
if( m_chargeReady != 2 )
#ifdef CLIENT_DLL
if ( legacy_satchel->value > 0 )
#else
if ( m_pPlayer->m_iLegacySatchel > 0 )
#endif
switch (m_chargeReady)
{
case 0:
Throw();
break;
case 1:
Detonate();
break;
}
else
// we're reloading, don't allow fire
if( m_chargeReady != 2 )
{
Throw();
}
}

void CSatchel::SecondaryAttack( void )
{
#ifdef CLIENT_DLL
if ( legacy_satchel->value > 0 )
#else
if ( m_pPlayer->m_iLegacySatchel > 0 )
#endif
{
Throw();
// we're reloading, don't allow fire
if( m_chargeReady != 2 )
{
Throw();
}
}
else
Detonate();
}


void CSatchel::SecondaryAttack( void )
void CSatchel::Detonate( void )
{
if ( m_chargeReady == 1 )
{
Expand Down
8 changes: 8 additions & 0 deletions dlls/singleplay_gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,3 +406,11 @@ BOOL CHalfLifeRules :: FAllowMonsters( void )
{
return TRUE;
}

//=========================================================
//=========================================================
void CHalfLifeRules::ClientUserInfoChanged( CBasePlayer *pPlayer, char *infobuffer )
{
// Set preferences
pPlayer->SetPrefsFromUserinfo( infobuffer );
}
1 change: 1 addition & 0 deletions dlls/weapons.h
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,7 @@ class CSatchel : public CBasePlayerWeapon
void Holster( int skiplocal = 0 );
void WeaponIdle( void );
void Throw( void );
void Detonate( void );

virtual BOOL UseDecrement( void )
{
Expand Down