From b30c90e2d175474b69019158df29a203d530442b Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Sun, 5 Jul 2020 08:20:17 +0500 Subject: [PATCH] One shot per click. --- dlls/glock.cpp | 3 +++ dlls/noffice/torch.cpp | 3 +++ dlls/shotgun.cpp | 3 +++ 3 files changed, 9 insertions(+) diff --git a/dlls/glock.cpp b/dlls/glock.cpp index 683b9b6f..d863f3fb 100644 --- a/dlls/glock.cpp +++ b/dlls/glock.cpp @@ -127,6 +127,9 @@ void CGlock::SecondaryAttack( void ) void CGlock::PrimaryAttack( void ) { + if( FBitSet( m_pPlayer->m_afButtonLast, IN_ATTACK ) ) + return; + GlockFire( 0.01, 0.2, TRUE ); } diff --git a/dlls/noffice/torch.cpp b/dlls/noffice/torch.cpp index 250baf40..b2bee645 100644 --- a/dlls/noffice/torch.cpp +++ b/dlls/noffice/torch.cpp @@ -101,6 +101,9 @@ void CTorch::Holster( int skiplocal /*= 0*/ ) void CTorch::PrimaryAttack() { + if( FBitSet( m_pPlayer->m_afButtonLast, IN_ATTACK ) ) + return; + SendWeaponAnim( TORCH_SWITCH ); EMIT_SOUND( ENT( pev ), CHAN_VOICE, "items/flashlight1.wav", VOL_NORM, ATTN_NORM ); diff --git a/dlls/shotgun.cpp b/dlls/shotgun.cpp index ac9a49ff..7210e752 100644 --- a/dlls/shotgun.cpp +++ b/dlls/shotgun.cpp @@ -117,6 +117,9 @@ BOOL CShotgun::Deploy() void CShotgun::PrimaryAttack() { + if( FBitSet( m_pPlayer->m_afButtonLast, IN_ATTACK ) ) + return; + // don't fire underwater if( m_pPlayer->pev->waterlevel == 3 ) {