Skip to content
Permalink
Browse files

game: stored ammo from non clip weapon in ammo reserve

  • Loading branch information...
Aranud committed Sep 9, 2019
1 parent 6856273 commit b6a56ac7f7b597b854bb64a8ebd6d4d3338fdf9d
Showing with 8 additions and 14 deletions.
  1. +8 −14 src/game/g_items.c
@@ -553,25 +553,19 @@ int Pickup_Weapon(gentity_t *ent, gentity_t *other)
other->client->ps.ammoclip[GetWeaponTableData(ent->item->giWeapon)->clipIndex] = 0;
other->client->ps.ammo[GetWeaponTableData(ent->item->giWeapon)->ammoIndex] = 0;

if (GetWeaponTableData(ent->item->giWeapon)->type & WEAPON_TYPE_MORTAR)
if (GetWeaponTableData(ent->item->giWeapon)->useClip)
{
other->client->ps.ammo[GetWeaponTableData(ent->item->giWeapon)->clipIndex] = quantity;

// secondary weapon ammo
if (ent->delay != 0.f)
{
Add_Ammo(other, GetWeaponTableData(ent->item->giWeapon)->weapAlts, ent->delay, qfalse);
}
other->client->ps.ammoclip[GetWeaponTableData(ent->item->giWeapon)->clipIndex] = quantity;
}
else
{
other->client->ps.ammoclip[GetWeaponTableData(ent->item->giWeapon)->clipIndex] = quantity;
other->client->ps.ammo[GetWeaponTableData(ent->item->giWeapon)->clipIndex] = quantity;
}

// secondary weapon ammo
if (ent->delay != 0.f)
{
other->client->ps.ammo[GetWeaponTableData(ent->item->giWeapon)->weapAlts] = ent->delay;
}
// secondary weapon ammo (riflenade)
if (ent->delay != 0.f)
{
other->client->ps.ammo[GetWeaponTableData(ent->item->giWeapon)->weapAlts] = ent->delay;
}
}
else

0 comments on commit b6a56ac

Please sign in to comment.
You can’t perform that action at this time.