hedgewars/uAmmos.pas
changeset 5273 102728b20c4d
parent 5272 a85d331ab5bb
child 5316 191cd6c06203
equal deleted inserted replaced
5272:a85d331ab5bb 5273:102728b20c4d
   175              end
   175              end
   176       end
   176       end
   177 end;
   177 end;
   178 
   178 
   179 procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType);
   179 procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType);
   180 begin
   180 var cnt: LongWord;
   181 if GetAmmoEntry(Hedgehog, ammo)^.Count <> AMMO_INFINITE then
   181 begin
   182     AddAmmo(Hedgehog, ammo, Ammoz[ammo].NumberInCase);
   182 cnt:= GetAmmoEntry(Hedgehog, ammo)^.Count;
       
   183 if cnt <> AMMO_INFINITE then
       
   184     begin
       
   185     inc(cnt, Ammoz[ammo].NumberInCase);
       
   186     AddAmmo(Hedgehog, ammo, cnt)
       
   187     end
   183 end;
   188 end;
   184 
   189 
   185 procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType; cnt: LongWord);
   190 procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType; cnt: LongWord);
   186 var ammos: TAmmoCounts;
   191 var ammos: TAmmoCounts;
   187     slot, ami: LongInt;
   192     slot, ami: LongInt;