mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-09-10 21:22:16 +00:00
Remove WeaponTick and override ItemPostFrame instead.
This commit is contained in:
parent
397286021c
commit
464a678b33
@ -302,7 +302,7 @@ void CShotgun::Reload( void )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CShotgun::WeaponTick()
|
void CShotgun::ItemPostFrame( void )
|
||||||
{
|
{
|
||||||
if( m_flPumpTime && m_flPumpTime < gpGlobals->time )
|
if( m_flPumpTime && m_flPumpTime < gpGlobals->time )
|
||||||
{
|
{
|
||||||
@ -310,6 +310,8 @@ void CShotgun::WeaponTick()
|
|||||||
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/scock1.wav", 1, ATTN_NORM, 0, 95 + RANDOM_LONG( 0, 0x1f ) );
|
EMIT_SOUND_DYN( ENT( m_pPlayer->pev ), CHAN_ITEM, "weapons/scock1.wav", 1, ATTN_NORM, 0, 95 + RANDOM_LONG( 0, 0x1f ) );
|
||||||
m_flPumpTime = 0;
|
m_flPumpTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CBasePlayerWeapon::ItemPostFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CShotgun::WeaponIdle( void )
|
void CShotgun::WeaponIdle( void )
|
||||||
|
@ -602,8 +602,6 @@ BOOL CanAttack( float attack_time, float curtime, BOOL isPredicted )
|
|||||||
|
|
||||||
void CBasePlayerWeapon::ItemPostFrame( void )
|
void CBasePlayerWeapon::ItemPostFrame( void )
|
||||||
{
|
{
|
||||||
WeaponTick();
|
|
||||||
|
|
||||||
if( ( m_fInReload ) && ( m_pPlayer->m_flNextAttack <= UTIL_WeaponTimeBase() ) )
|
if( ( m_fInReload ) && ( m_pPlayer->m_flNextAttack <= UTIL_WeaponTimeBase() ) )
|
||||||
{
|
{
|
||||||
// complete the reload.
|
// complete the reload.
|
||||||
|
@ -319,7 +319,6 @@ public:
|
|||||||
virtual void PrimaryAttack( void ) { return; } // do "+ATTACK"
|
virtual void PrimaryAttack( void ) { return; } // do "+ATTACK"
|
||||||
virtual void SecondaryAttack( void ) { return; } // do "+ATTACK2"
|
virtual void SecondaryAttack( void ) { return; } // do "+ATTACK2"
|
||||||
virtual void Reload( void ) { return; } // do "+RELOAD"
|
virtual void Reload( void ) { return; } // do "+RELOAD"
|
||||||
virtual void WeaponTick() {} // Always called at beginning of ItemPostFrame. - Solokiller
|
|
||||||
virtual void WeaponIdle( void ) { return; } // called when no buttons pressed
|
virtual void WeaponIdle( void ) { return; } // called when no buttons pressed
|
||||||
virtual int UpdateClientData( CBasePlayer *pPlayer ); // sends hud info to client dll, if things have changed
|
virtual int UpdateClientData( CBasePlayer *pPlayer ); // sends hud info to client dll, if things have changed
|
||||||
virtual void RetireWeapon( void );
|
virtual void RetireWeapon( void );
|
||||||
@ -639,8 +638,8 @@ public:
|
|||||||
void SecondaryAttack( void );
|
void SecondaryAttack( void );
|
||||||
BOOL Deploy( );
|
BOOL Deploy( );
|
||||||
void Reload( void );
|
void Reload( void );
|
||||||
void WeaponTick();
|
|
||||||
void WeaponIdle( void );
|
void WeaponIdle( void );
|
||||||
|
void ItemPostFrame( void );
|
||||||
int m_fInReload;
|
int m_fInReload;
|
||||||
float m_flNextReload;
|
float m_flNextReload;
|
||||||
int m_iShell;
|
int m_iShell;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user