From: terencehill Date: Wed, 28 Dec 2016 18:39:29 +0000 (+0100) Subject: Fix ammo rating, it was always rated 0 X-Git-Tag: xonotic-v0.8.2~343^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8864567ea710555af39cac30456582afcc7ab4af;p=xonotic%2Fxonotic-data.pk3dir.git Fix ammo rating, it was always rated 0 --- diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index ebab941c0..b506141e8 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -1001,18 +1001,15 @@ float commodity_pickupevalfunc(entity player, entity item) if(!(player.weapons & (it.m_wepset))) continue; - if(it.items & ITEM_Shells.m_itemid) - need_shells = true; - else if(it.items & ITEM_Bullets.m_itemid) - need_nails = true; - else if(it.items & ITEM_Rockets.m_itemid) - need_rockets = true; - else if(it.items & ITEM_Cells.m_itemid) - need_cells = true; - else if(it.items & ITEM_Plasma.m_itemid) - need_plasma = true; - else if(it.items & ITEM_JetpackFuel.m_itemid) - need_fuel = true; + switch(it.ammo_field) + { + case ammo_shells: need_shells = true; break; + case ammo_nails: need_nails = true; break; + case ammo_rockets: need_rockets = true; break; + case ammo_cells: need_cells = true; break; + case ammo_plasma: need_plasma = true; break; + case ammo_fuel: need_fuel = true; break; + } }); // TODO: figure out if the player even has the weapon this ammo is for?