diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index 27c6aa26..6e524918 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -1292,8 +1292,11 @@ CWeaponBox *EXT_FUNC __API_HOOK(CreateWeaponBox)(CBasePlayerItem *pItem, CBasePl bool exhaustibleAmmo = (pItem->iFlags() & ITEM_FLAG_EXHAUSTIBLE) == ITEM_FLAG_EXHAUSTIBLE; if (exhaustibleAmmo || packAmmo) { +#ifndef REGAMEDLL_ADD pWeaponBox->PackAmmo(MAKE_STRING(pItem->pszAmmo1()), pPlayerOwner->m_rgAmmo[pItem->PrimaryAmmoIndex()]); - +#else + pWeaponBox->GiveAmmo(pPlayerOwner->m_rgAmmo[pItem->PrimaryAmmoIndex()], (char *)pItem->pszAmmo1(), pItem->iMaxAmmo1()); +#endif if (exhaustibleAmmo) { pPlayerOwner->m_rgAmmo[pItem->PrimaryAmmoIndex()] = 0; diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index 0029269a..b3746dea 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -2032,7 +2032,11 @@ void CWeaponBox::Touch(CBaseEntity *pOther) if (!FStringNull(m_rgiszAmmo[n])) { // there's some ammo of this type. +#ifndef REGAMEDLL_ADD pPlayer->GiveAmmo(m_rgAmmo[n], (char *)STRING(m_rgiszAmmo[n]), MaxAmmoCarry(m_rgiszAmmo[n])); +#else + pPlayer->GiveAmmo(m_rgAmmo[n], STRING(m_rgiszAmmo[n]), m_rgAmmo[n]); +#endif // now empty the ammo from the weaponbox since we just gave it to the player m_rgiszAmmo[n] = iStringNull;