@@ -953,44 +953,47 @@ void CConfigurableWeapon::PerformWeaponFire(bool altMode)
953
953
const int ammoPerFire = fire.ammoPerFire .Get (altMode);
954
954
const bool useSecondaryAmmo = fire.useSecondaryAmmo .Get (altMode);
955
955
956
- if (useSecondaryAmmo )
956
+ if (ammoPerFire > 0 )
957
957
{
958
- if (m_iSecondaryAmmoType > 0 )
958
+ if (useSecondaryAmmo )
959
959
{
960
- if (m_pPlayer-> m_rgAmmo [ SecondaryAmmoIndex ()] < ammoPerFire )
960
+ if (m_iSecondaryAmmoType > 0 )
961
961
{
962
- PlayEmptySound (altMode);
963
- return ;
962
+ if (m_pPlayer->m_rgAmmo [SecondaryAmmoIndex ()] < ammoPerFire)
963
+ {
964
+ PlayEmptySound (altMode);
965
+ return ;
966
+ }
967
+ m_pPlayer->m_rgAmmo [SecondaryAmmoIndex ()] -= ammoPerFire;
968
+ m_pPlayer->m_rgAmmo [SecondaryAmmoIndex ()] = Q_max (0 , m_pPlayer->m_rgAmmo [SecondaryAmmoIndex ()]);
964
969
}
965
- m_pPlayer->m_rgAmmo [SecondaryAmmoIndex ()] -= ammoPerFire;
966
- m_pPlayer->m_rgAmmo [SecondaryAmmoIndex ()] = Q_max (0 , m_pPlayer->m_rgAmmo [SecondaryAmmoIndex ()]);
967
970
}
968
- }
969
- else
970
- {
971
- if (UsesAmmo ())
971
+ else
972
972
{
973
- if (! HasAmmoToFire (ammoPerFire ))
973
+ if (UsesAmmo ( ))
974
974
{
975
- if (UsesClip () && params. reloadAutostart )
975
+ if (! HasAmmoToFire (ammoPerFire) )
976
976
{
977
- Reload ();
978
- if (! HasAmmoToFire (ammoPerFire))
979
- PlayEmptySound (altMode );
980
- }
981
- else
982
- {
983
- if (m_fFireOnEmpty)
977
+ if ( UsesClip () && params. reloadAutostart )
978
+ {
979
+ Reload ( );
980
+ if (! HasAmmoToFire (ammoPerFire))
981
+ PlayEmptySound (altMode);
982
+ }
983
+ else
984
984
{
985
- PlayEmptySound (altMode);
986
- m_flNextPrimaryAttack = GetNextAttackDelay (fire.delayAfterEmpty .Get (altMode));
985
+ if (m_fFireOnEmpty)
986
+ {
987
+ PlayEmptySound (altMode);
988
+ m_flNextPrimaryAttack = GetNextAttackDelay (fire.delayAfterEmpty .Get (altMode));
989
+ }
987
990
}
991
+ return ;
988
992
}
989
- return ;
993
+ SpendAmmo (ammoPerFire);
994
+ UpdateRechargeTime (altMode);
995
+ OnSpendAmmo ();
990
996
}
991
- SpendAmmo (ammoPerFire);
992
- UpdateRechargeTime (altMode);
993
- OnSpendAmmo ();
994
997
}
995
998
}
996
999
@@ -1217,12 +1220,15 @@ void CConfigurableWeapon::PerformWeaponFire(bool altMode)
1217
1220
m_flNextSecondaryAttack = Q_max (m_flNextPrimaryAttack, m_flNextSecondaryAttack);
1218
1221
}
1219
1222
1220
- if (useSecondaryAmmo)
1221
- CheckOutOfSecondaryAmmo ();
1222
- else
1223
+ if (ammoPerFire > 0 )
1223
1224
{
1224
- if (!CanRechargeAmmo ())
1225
- CheckOutOfAmmo ();
1225
+ if (useSecondaryAmmo)
1226
+ CheckOutOfSecondaryAmmo ();
1227
+ else
1228
+ {
1229
+ if (!CanRechargeAmmo ())
1230
+ CheckOutOfAmmo ();
1231
+ }
1226
1232
}
1227
1233
1228
1234
const float pumpTime = fire.pumpDelay .Get (altMode);
0 commit comments