Skip to content

Commit

Permalink
Fix CTF backpack sound still playing when not giving ammo
Browse files Browse the repository at this point in the history
Resolves #39
  • Loading branch information
SamVanheer committed Jan 23, 2022
1 parent 5b77082 commit afea7bf
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion dlls/crossbow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ bool CCrossbow::GetItemInfo(ItemInfo* p)

void CCrossbow::IncrementAmmo(CBasePlayer* pPlayer)
{
if (pPlayer->GiveAmmo(1, "bolts", BOLT_MAX_CARRY) != 0)
if (pPlayer->GiveAmmo(1, "bolts", BOLT_MAX_CARRY) >= 0)
{
EMIT_SOUND(pPlayer->edict(), CHAN_STATIC, "ctf/pow_backpack.wav", 0.5, ATTN_NORM);
}
Expand Down
2 changes: 1 addition & 1 deletion dlls/egon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ bool CEgon::GetItemInfo(ItemInfo* p)

void CEgon::IncrementAmmo(CBasePlayer* pPlayer)
{
if (pPlayer->GiveAmmo(1, "uranium", URANIUM_MAX_CARRY) != 0)
if (pPlayer->GiveAmmo(1, "uranium", URANIUM_MAX_CARRY) >= 0)
{
EMIT_SOUND(pPlayer->edict(), CHAN_STATIC, "ctf/pow_backpack.wav", 0.5, ATTN_NORM);
}
Expand Down
2 changes: 1 addition & 1 deletion dlls/gauss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ bool CGauss::GetItemInfo(ItemInfo* p)

void CGauss::IncrementAmmo(CBasePlayer* pPlayer)
{
if (pPlayer->GiveAmmo(1, "uranium", URANIUM_MAX_CARRY) != 0)
if (pPlayer->GiveAmmo(1, "uranium", URANIUM_MAX_CARRY) >= 0)
{
EMIT_SOUND(pPlayer->edict(), CHAN_STATIC, "ctf/pow_backpack.wav", 0.5, ATTN_NORM);
}
Expand Down
2 changes: 1 addition & 1 deletion dlls/glock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bool CGlock::GetItemInfo(ItemInfo* p)

void CGlock::IncrementAmmo(CBasePlayer* pPlayer)
{
if (pPlayer->GiveAmmo(1, "9mm", _9MM_MAX_CARRY) != 0)
if (pPlayer->GiveAmmo(1, "9mm", _9MM_MAX_CARRY) >= 0)
{
EMIT_SOUND(pPlayer->edict(), CHAN_STATIC, "ctf/pow_backpack.wav", 0.5, ATTN_NORM);
}
Expand Down
2 changes: 1 addition & 1 deletion dlls/handgrenade.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ void CHandGrenade::IncrementAmmo(CBasePlayer* pPlayer)
}
#endif

if (pPlayer->GiveAmmo(1, "Hand Grenade", HANDGRENADE_MAX_CARRY) != 0)
if (pPlayer->GiveAmmo(1, "Hand Grenade", HANDGRENADE_MAX_CARRY) >= 0)
{
EMIT_SOUND(pPlayer->edict(), CHAN_STATIC, "ctf/pow_backpack.wav", 0.5, ATTN_NORM);
}
Expand Down
2 changes: 1 addition & 1 deletion dlls/mp5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ bool CMP5::GetItemInfo(ItemInfo* p)

void CMP5::IncrementAmmo(CBasePlayer* pPlayer)
{
if (pPlayer->GiveAmmo(1, "9mm", _9MM_MAX_CARRY) != 0)
if (pPlayer->GiveAmmo(1, "9mm", _9MM_MAX_CARRY) >= 0)
{
EMIT_SOUND(pPlayer->edict(), CHAN_STATIC, "ctf/pow_backpack.wav", 0.5, ATTN_NORM);
}
Expand Down
2 changes: 1 addition & 1 deletion dlls/python.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ bool CPython::GetItemInfo(ItemInfo* p)

void CPython::IncrementAmmo(CBasePlayer* pPlayer)
{
if (pPlayer->GiveAmmo(1, "357", _357_MAX_CARRY) != 0)
if (pPlayer->GiveAmmo(1, "357", _357_MAX_CARRY) >= 0)
{
EMIT_SOUND(pPlayer->edict(), CHAN_STATIC, "ctf/pow_backpack.wav", 0.5, ATTN_NORM);
}
Expand Down
2 changes: 1 addition & 1 deletion dlls/rpg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ bool CRpg::GetItemInfo(ItemInfo* p)

void CRpg::IncrementAmmo(CBasePlayer* pPlayer)
{
if (pPlayer->GiveAmmo(1, "rockets", ROCKET_MAX_CARRY) != 0)
if (pPlayer->GiveAmmo(1, "rockets", ROCKET_MAX_CARRY) >= 0)
{
EMIT_SOUND(pPlayer->edict(), CHAN_STATIC, "ctf/pow_backpack.wav", 0.5, ATTN_NORM);
}
Expand Down
2 changes: 1 addition & 1 deletion dlls/shotgun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ bool CShotgun::GetItemInfo(ItemInfo* p)

void CShotgun::IncrementAmmo(CBasePlayer* pPlayer)
{
if (pPlayer->GiveAmmo(1, "buckshot", BUCKSHOT_MAX_CARRY) != 0)
if (pPlayer->GiveAmmo(1, "buckshot", BUCKSHOT_MAX_CARRY) >= 0)
{
EMIT_SOUND(pPlayer->edict(), CHAN_STATIC, "ctf/pow_backpack.wav", 0.5, ATTN_NORM);
}
Expand Down
2 changes: 1 addition & 1 deletion dlls/weapons/CDisplacer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ bool CDisplacer::GetItemInfo(ItemInfo* p)

void CDisplacer::IncrementAmmo(CBasePlayer* pPlayer)
{
if (pPlayer->GiveAmmo(1, "uranium", URANIUM_MAX_CARRY) != 0)
if (pPlayer->GiveAmmo(1, "uranium", URANIUM_MAX_CARRY) >= 0)
{
EMIT_SOUND(pPlayer->edict(), CHAN_STATIC, "ctf/pow_backpack.wav", 0.5, ATTN_NORM);
}
Expand Down
2 changes: 1 addition & 1 deletion dlls/weapons/CEagle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ bool CEagle::GetItemInfo(ItemInfo* p)

void CEagle::IncrementAmmo(CBasePlayer* pPlayer)
{
if (pPlayer->GiveAmmo(1, "357", _357_MAX_CARRY) != 0)
if (pPlayer->GiveAmmo(1, "357", _357_MAX_CARRY) >= 0)
{
EMIT_SOUND(pPlayer->edict(), CHAN_STATIC, "ctf/pow_backpack.wav", 0.5, ATTN_NORM);
}
Expand Down
2 changes: 1 addition & 1 deletion dlls/weapons/CM249.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ bool CM249::GetItemInfo(ItemInfo* p)

void CM249::IncrementAmmo(CBasePlayer* pPlayer)
{
if (pPlayer->GiveAmmo(1, "556", M249_MAX_CARRY) != 0)
if (pPlayer->GiveAmmo(1, "556", M249_MAX_CARRY) >= 0)
{
EMIT_SOUND(pPlayer->edict(), CHAN_STATIC, "ctf/pow_backpack.wav", 0.5, ATTN_NORM);
}
Expand Down
2 changes: 1 addition & 1 deletion dlls/weapons/CSniperRifle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ bool CSniperRifle::GetItemInfo(ItemInfo* p)

void CSniperRifle::IncrementAmmo(CBasePlayer* pPlayer)
{
if (pPlayer->GiveAmmo(1, "762", SNIPERRIFLE_MAX_CARRY) != 0)
if (pPlayer->GiveAmmo(1, "762", SNIPERRIFLE_MAX_CARRY) >= 0)
{
EMIT_SOUND(pPlayer->edict(), CHAN_STATIC, "ctf/pow_backpack.wav", 0.5, ATTN_NORM);
}
Expand Down
2 changes: 1 addition & 1 deletion dlls/weapons/CSporeLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ bool CSporeLauncher::GetItemInfo(ItemInfo* p)

void CSporeLauncher::IncrementAmmo(CBasePlayer* pPlayer)
{
if (pPlayer->GiveAmmo(1, "spores", SPORELAUNCHER_MAX_CARRY) != 0)
if (pPlayer->GiveAmmo(1, "spores", SPORELAUNCHER_MAX_CARRY) >= 0)
{
EMIT_SOUND(pPlayer->edict(), CHAN_STATIC, "ctf/pow_backpack.wav", 0.5, ATTN_NORM);
}
Expand Down

0 comments on commit afea7bf

Please sign in to comment.