--- 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);