Revert mp_refill_bpammo_weapons 3

This commit is contained in:
s1lentq 2020-10-27 01:01:28 +07:00
parent efb06a7a20
commit b0d0ffedff
2 changed files with 19 additions and 3 deletions

1
dist/game.cfg vendored
View File

@ -93,6 +93,7 @@ mp_auto_reload_weapons 0
// 0 - disabled (default behaviour)
// 1 - refill backpack ammo on player spawn
// 2 - refill backpack ammo on player spawn and on the purchase of the item
// 3 - refill backpack ammo on each weapon reload (NOTE: Useful for mods like DeathMatch, GunGame, ZombieMod etc.)
//
// Default value: "0"
mp_refill_bpammo_weapons 0

View File

@ -917,7 +917,15 @@ void CBasePlayerWeapon::ItemPostFrame()
// Add them to the clip
m_iClip += j;
m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] -= j;
#ifdef REGAMEDLL_ADD
// Do not remove bpammo of the player,
// if cvar allows to refill bpammo on during reloading the weapons
if (refill_bpammo_weapons.value < 3.0f)
#endif
{
m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType] -= j;
}
m_pPlayer->TabulateAmmo();
m_fInReload = FALSE;
@ -1436,8 +1444,15 @@ bool EXT_FUNC CBasePlayerWeapon::__API_HOOK(DefaultShotgunReload)(int iAnim, int
#endif
{
m_iClip++;
m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--;
m_pPlayer->ammo_buckshot--;
#ifdef REGAMEDLL_ADD
if (refill_bpammo_weapons.value < 3.0f)
#endif
{
m_pPlayer->m_rgAmmo[m_iPrimaryAmmoType]--;
m_pPlayer->ammo_buckshot--;
}
m_fInSpecialReload = 1;
}