mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2024-12-26 22:55:41 +03:00
Weaponbox ammopack hardcode (#533)
This commit is contained in:
parent
c756bf89d1
commit
2f88574a94
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user