From: Lyberta Date: Fri, 28 Apr 2017 21:43:23 +0000 (+0300) Subject: Fixed GivePlayerAmmo. X-Git-Tag: xonotic-v0.8.5~2459^2~26 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d45e593ef8cfffe645ee76e566e1da938491baf2;p=xonotic%2Fxonotic-data.pk3dir.git Fixed GivePlayerAmmo. --- diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 642c29d29..6b2428bf7 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -668,14 +668,38 @@ void GivePlayerArmor(entity player, float amount) void GivePlayerAmmo(entity player, .float ammotype, float amount) { float maxvalue = 999; - switch(ammotype) - { - case ammo_shells: maxvalue = g_pickup_shells_max; - case ammo_cells: maxvalue = g_pickup_cells_max; - case ammo_rockets: maxvalue = g_pickup_rockets_max; - case ammo_plasma: maxvalue = g_pickup_plasma_max; - case ammo_nails: maxvalue = g_pickup_nails_max; - case ammo_fuel: maxvalue = g_pickup_fuel_max; + switch (ammotype) + { + case ammo_shells: + { + maxvalue = g_pickup_shells_max; + break; + } + case ammo_cells: + { + maxvalue = g_pickup_cells_max; + break; + } + case ammo_rockets: + { + maxvalue = g_pickup_rockets_max; + break; + } + case ammo_plasma: + { + maxvalue = g_pickup_plasma_max; + break; + } + case ammo_nails: + { + maxvalue = g_pickup_nails_max; + break; + } + case ammo_fuel: + { + maxvalue = g_pickup_fuel_max; + break; + } } player.(ammotype) = min(player.(ammotype) + amount, maxvalue); }