mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-26 14:45:38 +03:00
RemovePlayerItemEx: Reduce ammo supply for grenades and c4
This commit is contained in:
parent
e090a52846
commit
4b4cd88feb
@ -226,6 +226,14 @@ EXT_FUNC bool CCSPlayer::RemovePlayerItemEx(const char* pszItemName, bool bRemov
|
||||
|
||||
if (bRemoveAmmo) {
|
||||
pPlayer->m_rgAmmo[ pItem->PrimaryAmmoIndex() ] = 0;
|
||||
} else {
|
||||
// These weapons have a unique type of ammo that is used only by them
|
||||
// If a weapon is removed, its ammo is also reduced, unless the ammo can be used by another weapon
|
||||
if (IsGrenadeWeapon(pItem->m_iId) || pItem->m_iId == WEAPON_C4)
|
||||
{
|
||||
if (pPlayer->m_rgAmmo[pItem->PrimaryAmmoIndex()] > 0)
|
||||
pPlayer->m_rgAmmo[pItem->PrimaryAmmoIndex()]--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user