File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6742,7 +6742,51 @@ void CTFWeaponBase::CheckReload( void )
67426742 }
67436743 else
67446744 {
6745- BaseClass::CheckReload ();
6745+ if ( m_bReloadsSingly )
6746+ {
6747+ CBasePlayer *pOwner = ToBasePlayer ( GetOwner () );
6748+ if ( !pOwner )
6749+ return ;
6750+
6751+ if ((m_bInReload) && (m_flNextPrimaryAttack <= gpGlobals->curtime ))
6752+ {
6753+ // TODO(mcoms): what if we have a secondary fire action?
6754+ if ( pOwner->m_nButtons & IN_ATTACK && m_iClip1 > 0 )
6755+ {
6756+ m_bInReload = false ;
6757+ return ;
6758+ }
6759+
6760+ // If out of ammo end reload
6761+ if (pOwner->GetAmmoCount (m_iPrimaryAmmoType) <=0 )
6762+ {
6763+ FinishReload ();
6764+ return ;
6765+ }
6766+ // If clip not full reload again
6767+ else if (m_iClip1 < GetMaxClip1 ())
6768+ {
6769+ // Add them to the clip
6770+ m_iClip1 += 1 ;
6771+ pOwner->RemoveAmmo ( 1 , m_iPrimaryAmmoType );
6772+
6773+ Reload ();
6774+ return ;
6775+ }
6776+ // Clip full, stop reloading
6777+ else
6778+ {
6779+ FinishReload ();
6780+ m_flNextPrimaryAttack = gpGlobals->curtime ;
6781+ m_flNextSecondaryAttack = gpGlobals->curtime ;
6782+ return ;
6783+ }
6784+ }
6785+ }
6786+ else
6787+ {
6788+ BaseClass::CheckReload ();
6789+ }
67466790 }
67476791}
67486792
You can’t perform that action at this time.
0 commit comments