Fixed ammo (missing sound)

This commit is contained in:
s1lent 2017-11-04 05:32:28 +07:00
parent 10ee63d807
commit 0fa5e32208
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
2 changed files with 9 additions and 2 deletions

View File

@ -76,6 +76,9 @@ void CBasePlayerAmmo::DefaultTouch(CBaseEntity *pOther)
SetTouch(nullptr);
SetThink(&CBaseEntity::SUB_Remove);
pev->nextthink = gpGlobals->time + 0.1f;
#ifdef REGAMEDLL_FIXES
pev->owner = ENT(pOther->pev);
#endif
}
}
else if (gEvilImpulse101)

View File

@ -2201,10 +2201,14 @@ 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, info->maxRounds) == -1)
if (pPlayer->GiveAmmo(info->buyClipSize, info->ammoName2, weapon->iMaxAmmo1()) == -1)
return false;
EMIT_SOUND(ENT(weapon->pev), CHAN_ITEM, "items/9mmclip1.wav", VOL_NORM, ATTN_NORM);
#else
pPlayer->GiveNamedItem(info->ammoName1);
if (!pPlayer->GiveNamedItemEx(info->ammoName1)) {
return false;
}
#endif
pPlayer->AddAccount(-info->clipCost, RT_PLAYER_BOUGHT_SOMETHING);