hedgewars/uAmmos.pas
changeset 5680 c0107c991dda
parent 5676 a655dfab27d7
child 5688 fba59d6b5b6c
equal deleted inserted replaced
5679:505c6448069b 5680:c0107c991dda
   182 procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType);
   182 procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType);
   183 var cnt: LongWord;
   183 var cnt: LongWord;
   184     a: PAmmo;
   184     a: PAmmo;
   185 begin
   185 begin
   186 a:= GetAmmoEntry(Hedgehog, ammo);
   186 a:= GetAmmoEntry(Hedgehog, ammo);
   187 if (a^.AmmoType = amNothing) or (a^.Count <> AMMO_INFINITE) then
   187 cnt:= a^.Count;
       
   188 if (a^.AmmoType = amNothing) or (cnt <> AMMO_INFINITE) then
   188     begin
   189     begin
   189     inc(cnt, Ammoz[ammo].NumberInCase);
   190     inc(cnt, Ammoz[ammo].NumberInCase);
   190     AddAmmo(Hedgehog, ammo, cnt)
   191     AddAmmo(Hedgehog, ammo, cnt)
   191     end
   192     end
   192 end;
   193 end;