]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Return early in GivePlayerAmmo.
authorLyberta <lyberta@lyberta.net>
Sat, 26 Aug 2017 16:40:59 +0000 (19:40 +0300)
committerLyberta <lyberta@lyberta.net>
Sat, 26 Aug 2017 16:40:59 +0000 (19:40 +0300)
qcsrc/common/t_items.qc

index 14a8f14bf05ef4395fd59d2e9cfb369dd6201399..d1d2cb1d91ff22a241bb2f2a1d41dbb16850e67a 100644 (file)
@@ -686,6 +686,10 @@ void GivePlayerArmor(entity player, float amount)
 
 void GivePlayerAmmo(entity player, .float ammotype, float amount)
 {
+       if (amount == 0)
+       {
+               return;
+       }
        float maxvalue = ITEM_COUNT_HARD_LIMIT;
        switch (ammotype)
        {