From d45e593ef8cfffe645ee76e566e1da938491baf2 Mon Sep 17 00:00:00 2001 From: Lyberta Date: Sat, 29 Apr 2017 00:43:23 +0300 Subject: [PATCH] Fixed GivePlayerAmmo. --- qcsrc/common/t_items.qc | 40 ++++++++++++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 8 deletions(-) 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); } -- 2.39.2