Ammo type hardcode fix (#882)

* Useful for custom ammo types.
This commit is contained in:
Vaqtincha 2023-10-25 09:37:32 +05:00 committed by GitHub
parent 7e02dea4a0
commit 426c975a88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2251,7 +2251,7 @@ bool EXT_FUNC __API_HOOK(BuyGunAmmo)(CBasePlayer *pPlayer, CBasePlayerItem *weap
if (pPlayer->m_iAccount >= info->clipCost)
{
#ifdef REGAMEDLL_FIXES
if (pPlayer->GiveAmmo(info->buyClipSize, info->ammoName2, weapon->iMaxAmmo1()) == -1)
if (pPlayer->GiveAmmo(info->buyClipSize, weapon->pszAmmo1(), weapon->iMaxAmmo1()) == -1)
return false;
EMIT_SOUND(ENT(weapon->pev), CHAN_ITEM, "items/9mmclip1.wav", VOL_NORM, ATTN_NORM);
@ -4813,7 +4813,7 @@ int EXT_FUNC GetWeaponData(edict_t *pEdict, struct weapon_data_s *info)
const WeaponInfoStruct *wpnInfo = GetDefaultWeaponInfo(II.iId);
if (wpnInfo && wpnInfo->gunClipSize != II.iMaxClip)
item->m_iClip = wpnInfo->gunClipSize;
item->m_iClip = wpnInfo->gunClipSize;
}
#endif
}