]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fixed GivePlayerAmmo.
authorLyberta <lyberta@lyberta.net>
Fri, 28 Apr 2017 21:43:23 +0000 (00:43 +0300)
committerLyberta <lyberta@lyberta.net>
Fri, 28 Apr 2017 21:43:23 +0000 (00:43 +0300)
qcsrc/common/t_items.qc

index 642c29d29a85e580143bedde5e20b3a542319eb1..6b2428bf7803b4719d304a231d3e8a3525f1a2c1 100644 (file)
@@ -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);
 }