oops
authornemo
Mon, 20 Jun 2011 19:00:19 -0400
changeset 5273 102728b20c4d
parent 5272 a85d331ab5bb
child 5274 941da059472b
oops
hedgewars/uAmmos.pas
--- a/hedgewars/uAmmos.pas	Mon Jun 20 18:58:26 2011 -0400
+++ b/hedgewars/uAmmos.pas	Mon Jun 20 19:00:19 2011 -0400
@@ -177,9 +177,14 @@
 end;
 
 procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType);
+var cnt: LongWord;
 begin
-if GetAmmoEntry(Hedgehog, ammo)^.Count <> AMMO_INFINITE then
-    AddAmmo(Hedgehog, ammo, Ammoz[ammo].NumberInCase);
+cnt:= GetAmmoEntry(Hedgehog, ammo)^.Count;
+if cnt <> AMMO_INFINITE then
+    begin
+    inc(cnt, Ammoz[ammo].NumberInCase);
+    AddAmmo(Hedgehog, ammo, cnt)
+    end
 end;
 
 procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType; cnt: LongWord);