hedgewars/uAmmos.pas
changeset 12733 353cb2ce6f9c
parent 12691 286afe079117
child 13456 794dcf69a5aa
--- a/hedgewars/uAmmos.pas	Sat Oct 21 16:47:20 2017 -0400
+++ b/hedgewars/uAmmos.pas	Sat Oct 21 23:03:52 2017 +0200
@@ -210,11 +210,11 @@
     cnt:= a^.Count
 else
     cnt:= 0;
-if (cnt <> AMMO_INFINITE) then
-    begin
+if (cnt >= AMMO_INFINITE) or (amt >= AMMO_INFINITE) then
+    cnt:= AMMO_INFINITE
+else
     cnt:= min(AMMO_FINITE_MAX, cnt + amt);
-    SetAmmo(Hedgehog, ammo, cnt)
-    end
+SetAmmo(Hedgehog, ammo, cnt);
 end;
 
 procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType);