# HG changeset patch # User nemo # Date 1308610819 14400 # Node ID 102728b20c4d30b0560b33a5501adccfa8260610 # Parent a85d331ab5bb43fbf682cb8578f77a560856df7e oops diff -r a85d331ab5bb -r 102728b20c4d 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);