Skip to content

Commit

Permalink
Ammo type hardcode fix (rehlds#882)
Browse files Browse the repository at this point in the history
* Useful for custom ammo types.
  • Loading branch information
Vaqtincha authored Oct 25, 2023
1 parent 7e02dea commit 426c975
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions regamedll/dlls/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 426c975

Please sign in to comment.