Skip to content

Commit

Permalink
Remove unused skiplocal parameter
Browse files Browse the repository at this point in the history
Resolves #38
  • Loading branch information
SamVanheer committed Oct 21, 2021
1 parent 2ff6a81 commit 940bf0b
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 47 deletions.
2 changes: 1 addition & 1 deletion cl_dll/hl/hl_baseentity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ void CBasePlayerItem::DestroyItem() { }
int CBasePlayerItem::AddToPlayer( CBasePlayer *pPlayer ) { return TRUE; }
void CBasePlayerItem::Drop() { }
void CBasePlayerItem::Kill() { }
void CBasePlayerItem::Holster( int skiplocal ) { }
void CBasePlayerItem::Holster() { }
void CBasePlayerItem::AttachToPlayer ( CBasePlayer *pPlayer ) { }
int CBasePlayerWeapon::AddDuplicate( CBasePlayerItem *pOriginal ) { return 0; }
int CBasePlayerWeapon::AddToPlayer( CBasePlayer *pPlayer ) { return FALSE; }
Expand Down
8 changes: 4 additions & 4 deletions cl_dll/hl/hl_weapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ CBasePlayerWeapon :: DefaultDeploy
=====================
*/
BOOL CBasePlayerWeapon :: DefaultDeploy(const char *szViewModel, const char *szWeaponModel, int iAnim, const char *szAnimExt, int skiplocal, int body )
BOOL CBasePlayerWeapon :: DefaultDeploy(const char *szViewModel, const char *szWeaponModel, int iAnim, const char *szAnimExt, int body )
{
if ( !CanDeploy() )
return FALSE;

gEngfuncs.CL_LoadModel( szViewModel, &m_pPlayer->pev->viewmodel );

SendWeaponAnim( iAnim, skiplocal, body );
SendWeaponAnim( iAnim, body );

g_irunninggausspred = false;
m_pPlayer->m_flNextAttack = 0.5;
Expand Down Expand Up @@ -199,7 +199,7 @@ CBasePlayerWeapon::Holster
Put away weapon
=====================
*/
void CBasePlayerWeapon::Holster( int skiplocal /* = 0 */ )
void CBasePlayerWeapon::Holster()
{
m_fInReload = FALSE; // cancel any reload in progress.
g_irunninggausspred = false;
Expand All @@ -213,7 +213,7 @@ CBasePlayerWeapon::SendWeaponAnim
Animate weapon model
=====================
*/
void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int skiplocal, int body )
void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int body )
{
m_pPlayer->pev->weaponanim = iAnim;

Expand Down
2 changes: 1 addition & 1 deletion dlls/crossbow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ BOOL CCrossbow::Deploy( )
return DefaultDeploy( "models/v_crossbow.mdl", "models/p_crossbow.mdl", CROSSBOW_DRAW2, "bow" );
}

void CCrossbow::Holster( int skiplocal /* = 0 */ )
void CCrossbow::Holster()
{
m_fInReload = FALSE;// cancel any reload in progress.

Expand Down
2 changes: 1 addition & 1 deletion dlls/crowbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ BOOL CCrowbar::Deploy( )
return DefaultDeploy( "models/v_crowbar.mdl", "models/p_crowbar.mdl", CROWBAR_DRAW, "crowbar" );
}

void CCrowbar::Holster( int skiplocal /* = 0 */ )
void CCrowbar::Holster()
{
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
SendWeaponAnim( CROWBAR_HOLSTER );
Expand Down
2 changes: 1 addition & 1 deletion dlls/egon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ int CEgon::AddToPlayer( CBasePlayer *pPlayer )



void CEgon::Holster( int skiplocal /* = 0 */ )
void CEgon::Holster()
{
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
SendWeaponAnim( EGON_HOLSTER );
Expand Down
2 changes: 1 addition & 1 deletion dlls/gauss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ BOOL CGauss::Deploy( )
return DefaultDeploy( "models/v_gauss.mdl", "models/p_gauss.mdl", GAUSS_DRAW, "gauss" );
}

void CGauss::Holster( int skiplocal /* = 0 */ )
void CGauss::Holster()
{
PLAYBACK_EVENT_FULL( FEV_RELIABLE | FEV_GLOBAL, m_pPlayer->edict(), m_usGaussFire, 0.01, m_pPlayer->pev->origin, m_pPlayer->pev->angles, 0.0, 0.0, 0, 0, 0, 1 );

Expand Down
4 changes: 2 additions & 2 deletions dlls/h_cycler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class CWeaponCycler : public CBasePlayerWeapon
void PrimaryAttack() override;
void SecondaryAttack() override;
BOOL Deploy() override;
void Holster( int skiplocal = 0 ) override;
void Holster() override;
int m_iszModel;
int m_iModel;
};
Expand Down Expand Up @@ -349,7 +349,7 @@ BOOL CWeaponCycler::Deploy( )
}


void CWeaponCycler::Holster( int skiplocal /* = 0 */ )
void CWeaponCycler::Holster()
{
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
}
Expand Down
2 changes: 1 addition & 1 deletion dlls/handgrenade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ BOOL CHandGrenade::CanHolster()
return ( m_flStartThrow == 0 );
}

void CHandGrenade::Holster( int skiplocal /* = 0 */ )
void CHandGrenade::Holster()
{
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;

Expand Down
2 changes: 1 addition & 1 deletion dlls/hornetgun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ BOOL CHgun::Deploy( )
return DefaultDeploy( "models/v_hgun.mdl", "models/p_hgun.mdl", HGUN_UP, "hive" );
}

void CHgun::Holster( int skiplocal /* = 0 */ )
void CHgun::Holster()
{
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
SendWeaponAnim( HGUN_DOWN );
Expand Down
6 changes: 3 additions & 3 deletions dlls/python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ BOOL CPython::Deploy( )
pev->body = 0;
}

return DefaultDeploy( "models/v_357.mdl", "models/p_357.mdl", PYTHON_DRAW, "python", UseDecrement(), pev->body );
return DefaultDeploy( "models/v_357.mdl", "models/p_357.mdl", PYTHON_DRAW, "python", pev->body );
}


void CPython::Holster( int skiplocal /* = 0 */ )
void CPython::Holster()
{
m_fInReload = FALSE;// cancel any reload in progress.

Expand Down Expand Up @@ -260,7 +260,7 @@ void CPython::WeaponIdle()
bUseScope = g_pGameRules->IsMultiplayer();
#endif

SendWeaponAnim( iAnim, UseDecrement() ? 1 : 0, bUseScope );
SendWeaponAnim( iAnim, bUseScope );
}


Expand Down
2 changes: 1 addition & 1 deletion dlls/rpg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ BOOL CRpg::CanHolster()
return TRUE;
}

void CRpg::Holster( int skiplocal /* = 0 */ )
void CRpg::Holster()
{
m_fInReload = FALSE;// cancel any reload in progress.

Expand Down
2 changes: 1 addition & 1 deletion dlls/satchel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ BOOL CSatchel::Deploy( )
}


void CSatchel::Holster( int skiplocal /* = 0 */ )
void CSatchel::Holster()
{
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;

Expand Down
2 changes: 1 addition & 1 deletion dlls/squeakgrenade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ BOOL CSqueak::Deploy( )
}


void CSqueak::Holster( int skiplocal /* = 0 */ )
void CSqueak::Holster()
{
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;

Expand Down
2 changes: 1 addition & 1 deletion dlls/tripmine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ BOOL CTripmine::Deploy( )
}


void CTripmine::Holster( int skiplocal /* = 0 */ )
void CTripmine::Holster()
{
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;

Expand Down
15 changes: 6 additions & 9 deletions dlls/weapons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ void CBasePlayerItem::Kill()
pev->nextthink = gpGlobals->time + .1;
}

void CBasePlayerItem::Holster( int skiplocal /* = 0 */ )
void CBasePlayerItem::Holster()
{
m_pPlayer->pev->viewmodel = 0;
m_pPlayer->pev->weaponmodel = 0;
Expand Down Expand Up @@ -736,12 +736,9 @@ int CBasePlayerWeapon::UpdateClientData( CBasePlayer *pPlayer )
}


void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int skiplocal, int body )
void CBasePlayerWeapon::SendWeaponAnim( int iAnim, int body )
{
if ( UseDecrement() )
skiplocal = 1;
else
skiplocal = 0;
const bool skiplocal = UseDecrement() != FALSE;

m_pPlayer->pev->weaponanim = iAnim;

Expand Down Expand Up @@ -852,7 +849,7 @@ BOOL CBasePlayerWeapon :: IsUseable()
return FALSE;
}

BOOL CBasePlayerWeapon :: DefaultDeploy( const char *szViewModel, const char *szWeaponModel, int iAnim, const char *szAnimExt, int skiplocal /* = 0 */, int body )
BOOL CBasePlayerWeapon :: DefaultDeploy( const char *szViewModel, const char *szWeaponModel, int iAnim, const char *szAnimExt, int body )
{
if (!CanDeploy( ))
return FALSE;
Expand All @@ -861,7 +858,7 @@ BOOL CBasePlayerWeapon :: DefaultDeploy( const char *szViewModel, const char *sz
m_pPlayer->pev->viewmodel = MAKE_STRING(szViewModel);
m_pPlayer->pev->weaponmodel = MAKE_STRING(szWeaponModel);
strcpy( m_pPlayer->m_szAnimExtention, szAnimExt );
SendWeaponAnim( iAnim, skiplocal, body );
SendWeaponAnim( iAnim, body );

m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0;
Expand Down Expand Up @@ -895,7 +892,7 @@ int CBasePlayerWeapon::SecondaryAmmoIndex()
return m_iSecondaryAmmoType;
}

void CBasePlayerWeapon::Holster( int skiplocal /* = 0 */ )
void CBasePlayerWeapon::Holster()
{
m_fInReload = FALSE; // cancel any reload in progress.
m_pPlayer->pev->viewmodel = 0;
Expand Down
30 changes: 15 additions & 15 deletions dlls/weapons.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class CBasePlayerItem : public CBaseAnimating
{ return TRUE; }

virtual BOOL CanHolster() { return TRUE; }// can this weapon be put away right now?
virtual void Holster( int skiplocal = 0 );
virtual void Holster();
virtual void UpdateItemInfo() {}

virtual void ItemPreFrame() {} // called each frame by the player PreThink
Expand Down Expand Up @@ -316,11 +316,11 @@ class CBasePlayerWeapon : public CBasePlayerItem
virtual BOOL PlayEmptySound();
virtual void ResetEmptySound();

virtual void SendWeaponAnim( int iAnim, int skiplocal = 1, int body = 0 ); // skiplocal is 1 if client is predicting weapon animations
virtual void SendWeaponAnim( int iAnim, int body = 0 );

BOOL CanDeploy() override;
virtual BOOL IsUseable();
BOOL DefaultDeploy(const char *szViewModel, const char *szWeaponModel, int iAnim, const char *szAnimExt, int skiplocal = 0, int body = 0 );
BOOL DefaultDeploy(const char *szViewModel, const char *szWeaponModel, int iAnim, const char *szAnimExt, int body = 0 );
int DefaultReload( int iClipSize, int iAnim, float fDelay, int body = 0 );

void ItemPostFrame() override; // called each frame by the player PostThink
Expand All @@ -332,7 +332,7 @@ class CBasePlayerWeapon : public CBasePlayerItem
int UpdateClientData( CBasePlayer *pPlayer ) override; // sends hud info to client dll, if things have changed
virtual void RetireWeapon();
virtual BOOL ShouldWeaponIdle() {return FALSE; }
void Holster( int skiplocal = 0 ) override;
void Holster() override;
virtual BOOL UseDecrement() { return FALSE; }

int PrimaryAmmoIndex() override;
Expand Down Expand Up @@ -542,7 +542,7 @@ class CCrowbar : public CBasePlayerWeapon
void PrimaryAttack() override;
int Swing( int fFirst );
BOOL Deploy() override;
void Holster( int skiplocal = 0 ) override;
void Holster() override;
int m_iSwing;
TraceResult m_trHit;

Expand Down Expand Up @@ -581,7 +581,7 @@ class CPython : public CBasePlayerWeapon
void PrimaryAttack() override;
void SecondaryAttack() override;
BOOL Deploy() override;
void Holster( int skiplocal = 0 ) override;
void Holster() override;
void Reload() override;
void WeaponIdle() override;

Expand Down Expand Up @@ -671,7 +671,7 @@ class CCrossbow : public CBasePlayerWeapon
void SecondaryAttack() override;
int AddToPlayer( CBasePlayer *pPlayer ) override;
BOOL Deploy( ) override;
void Holster( int skiplocal = 0 ) override;
void Holster() override;
void Reload() override;
void WeaponIdle() override;

Expand Down Expand Up @@ -791,7 +791,7 @@ class CRpg : public CBasePlayerWeapon

BOOL Deploy() override;
BOOL CanHolster() override;
void Holster( int skiplocal = 0 ) override;
void Holster() override;

void PrimaryAttack() override;
void SecondaryAttack() override;
Expand Down Expand Up @@ -869,7 +869,7 @@ class CGauss : public CBasePlayerWeapon
int AddToPlayer( CBasePlayer *pPlayer ) override;

BOOL Deploy() override;
void Holster( int skiplocal = 0 ) override;
void Holster() override;

void PrimaryAttack() override;
void SecondaryAttack() override;
Expand Down Expand Up @@ -949,7 +949,7 @@ class CEgon : public CBasePlayerWeapon
int AddToPlayer( CBasePlayer *pPlayer ) override;

BOOL Deploy() override;
void Holster( int skiplocal = 0 ) override;
void Holster() override;

void UpdateEffect( const Vector &startPoint, const Vector &endPoint, float timeBlend );

Expand Down Expand Up @@ -1020,7 +1020,7 @@ class CHgun : public CBasePlayerWeapon
void SecondaryAttack() override;
BOOL Deploy() override;
BOOL IsUseable() override;
void Holster( int skiplocal = 0 ) override;
void Holster() override;
void Reload() override;
void WeaponIdle() override;
float m_flNextAnimTime;
Expand Down Expand Up @@ -1064,7 +1064,7 @@ class CHandGrenade : public CBasePlayerWeapon
void PrimaryAttack() override;
BOOL Deploy() override;
BOOL CanHolster() override;
void Holster( int skiplocal = 0 ) override;
void Holster() override;
void WeaponIdle() override;

BOOL UseDecrement() override
Expand Down Expand Up @@ -1116,7 +1116,7 @@ class CSatchel : public CBasePlayerWeapon
BOOL Deploy() override;
BOOL IsUseable() override;

void Holster( int skiplocal = 0 ) override;
void Holster() override;
void WeaponIdle() override;
void Throw();

Expand Down Expand Up @@ -1159,7 +1159,7 @@ class CTripmine : public CBasePlayerWeapon

void PrimaryAttack() override;
BOOL Deploy() override;
void Holster( int skiplocal = 0 ) override;
void Holster() override;
void WeaponIdle() override;

BOOL UseDecrement() override
Expand Down Expand Up @@ -1197,7 +1197,7 @@ class CSqueak : public CBasePlayerWeapon
void PrimaryAttack() override;
void SecondaryAttack() override;
BOOL Deploy() override;
void Holster( int skiplocal = 0 ) override;
void Holster() override;
void WeaponIdle() override;
int m_fJustThrown;

Expand Down
2 changes: 1 addition & 1 deletion dlls/weapons_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ BOOL CBasePlayerWeapon::DefaultReload(int iClipSize, int iAnim, float fDelay, in
m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + fDelay;

//!!UNDONE -- reload sound goes here !!!
SendWeaponAnim(iAnim, UseDecrement(), body);
SendWeaponAnim(iAnim, body);

m_fInReload = TRUE;

Expand Down
4 changes: 2 additions & 2 deletions dlls/wpn_shared/hl_wpn_glock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ int CGlock::GetItemInfo(ItemInfo *p)
BOOL CGlock::Deploy( )
{
// pev->body = 1;
return DefaultDeploy( "models/v_9mmhandgun.mdl", "models/p_9mmhandgun.mdl", GLOCK_DRAW, "onehanded", /*UseDecrement() ? 1 : 0*/ 0 );
return DefaultDeploy( "models/v_9mmhandgun.mdl", "models/p_9mmhandgun.mdl", GLOCK_DRAW, "onehanded" );
}

void CGlock::SecondaryAttack()
Expand Down Expand Up @@ -207,7 +207,7 @@ void CGlock::WeaponIdle()
iAnim = GLOCK_IDLE2;
m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 40.0 / 16.0;
}
SendWeaponAnim( iAnim, 1 );
SendWeaponAnim( iAnim );
}
}

Expand Down

0 comments on commit 940bf0b

Please sign in to comment.