Browse Source

Remove WeaponTick and override ItemPostFrame instead.

hl_urbicide
Andrey Akhmichin 4 years ago
parent
commit
464a678b33
  1. 4
      dlls/shotgun.cpp
  2. 2
      dlls/weapons.cpp
  3. 3
      dlls/weapons.h

4
dlls/shotgun.cpp

@ -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 )

2
dlls/weapons.cpp

@ -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.

3
dlls/weapons.h

@ -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…
Cancel
Save