From e1483e1fcfa1083e8138f75c1355ff07297ef02d Mon Sep 17 00:00:00 2001 From: Night Owl Date: Mon, 29 Aug 2016 23:33:17 +0500 Subject: [PATCH] Merge some code from hlsdk2.4. --- dlls/weapons.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/weapons.cpp b/dlls/weapons.cpp index ca91b778..5a592bf2 100644 --- a/dlls/weapons.cpp +++ b/dlls/weapons.cpp @@ -601,6 +601,11 @@ void CBasePlayerWeapon::ItemPostFrame( void ) m_fInReload = FALSE; } + if( !( m_pPlayer->pev->button & IN_ATTACK ) ) + { + m_flLastFireTime = 0.0f; + } + if( ( m_pPlayer->pev->button & IN_ATTACK2 ) && CanAttack( m_flNextSecondaryAttack, gpGlobals->time, UseDecrement() ) ) { if( pszAmmo2() && !m_pPlayer->m_rgAmmo[SecondaryAmmoIndex()] ) @@ -932,6 +937,7 @@ BOOL CBasePlayerWeapon::DefaultDeploy( char *szViewModel, char *szWeaponModel, i m_pPlayer->m_flNextAttack = UTIL_WeaponTimeBase() + 0.5; m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 1.0; + m_flLastFireTime = 0.0f; return TRUE; }