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

View File

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

View File

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

View File

@ -58,6 +58,10 @@ public:
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
};