client and shotgun fixex

This commit is contained in:
celisej567 2025-01-02 23:53:02 +03:00
parent 9026dca97f
commit d24120a99e
4 changed files with 94 additions and 77 deletions

View File

@ -610,6 +610,12 @@ void CWeaponShotgun::ItemPostFrame( void )
return; return;
} }
#ifdef GAME_DLL
if (!m_bLowered)
{
#endif // GAME_DLL
// Shotgun uses same timing and ammo for secondary attack // Shotgun uses same timing and ammo for secondary attack
if ((m_bDelayedFire2 || pOwner->m_nButtons & IN_ATTACK2) && (m_flNextPrimaryAttack <= gpGlobals->curtime)) if ((m_bDelayedFire2 || pOwner->m_nButtons & IN_ATTACK2) && (m_flNextPrimaryAttack <= gpGlobals->curtime))
{ {
@ -681,6 +687,9 @@ void CWeaponShotgun::ItemPostFrame( void )
PrimaryAttack(); PrimaryAttack();
} }
} }
#ifdef GAME_DLL
}
#endif // GAME_DLL
if ( pOwner->m_nButtons & IN_RELOAD && UsesClipsForAmmo1() && !m_bInReload ) if ( pOwner->m_nButtons & IN_RELOAD && UsesClipsForAmmo1() && !m_bInReload )
{ {

View File

@ -94,6 +94,11 @@ CBaseCombatWeapon::CBaseCombatWeapon() : BASECOMBATWEAPON_DERIVED_FROM()
m_hWeaponFileInfo = GetInvalidWeaponInfoHandle(); m_hWeaponFileInfo = GetInvalidWeaponInfoHandle();
#ifdef GAME_DLL
m_bLowered = false;
m_flRaiseTime = gpGlobals->curtime;
#endif
#if defined( TF_DLL ) #if defined( TF_DLL )
UseClientSideAnimation(); UseClientSideAnimation();
#endif #endif

View File

@ -526,7 +526,6 @@ private:
CNetworkVar( CBaseCombatCharacterHandle, m_hOwner ); // Player carrying this weapon CNetworkVar( CBaseCombatCharacterHandle, m_hOwner ); // Player carrying this weapon
protected: protected:
#ifdef GAME_DLL #ifdef GAME_DLL
bool m_bLowered; // Whether the viewmodel is raised or lowered bool m_bLowered; // Whether the viewmodel is raised or lowered
float m_flRaiseTime; // If lowered, the time we should raise the viewmodel float m_flRaiseTime; // If lowered, the time we should raise the viewmodel

View File

@ -58,6 +58,10 @@ public:
protected: protected:
#ifndef GAME_DLL
bool m_bLowered; // Whether the viewmodel is raised or lowered
float m_flRaiseTime; // If lowered, the time we should raise the viewmodel
#endif
float m_flHolsterTime; // When the weapon was holstered float m_flHolsterTime; // When the weapon was holstered
}; };