hedgewars/uAmmos.pas
changeset 3407 dcc129c4352e
parent 3405 8fdb08497bf1
child 3697 d5b30d6373fc
equal deleted inserted replaced
3406:f4bdebced042 3407:dcc129c4352e
    55 
    55 
    56 procedure FillAmmoStore(Ammo: PHHAmmo; var cnts: TAmmoCounts);
    56 procedure FillAmmoStore(Ammo: PHHAmmo; var cnts: TAmmoCounts);
    57 var mi: array[0..cMaxSlotIndex] of byte;
    57 var mi: array[0..cMaxSlotIndex] of byte;
    58     a: TAmmoType;
    58     a: TAmmoType;
    59 begin
    59 begin
       
    60 {$HINTS OFF}
    60 FillChar(mi, sizeof(mi), 0);
    61 FillChar(mi, sizeof(mi), 0);
       
    62 {$HINTS ON}
    61 FillChar(Ammo^, sizeof(Ammo^), 0);
    63 FillChar(Ammo^, sizeof(Ammo^), 0);
    62 for a:= Low(TAmmoType) to High(TAmmoType) do
    64 for a:= Low(TAmmoType) to High(TAmmoType) do
    63     begin
    65     begin
    64     if cnts[a] > 0 then
    66     if cnts[a] > 0 then
    65        begin
    67        begin
   170 procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType);
   172 procedure AddAmmo(var Hedgehog: THedgehog; ammo: TAmmoType);
   171 var ammos: TAmmoCounts;
   173 var ammos: TAmmoCounts;
   172     slot, ami: LongInt;
   174     slot, ami: LongInt;
   173     hhammo: PHHAmmo;
   175     hhammo: PHHAmmo;
   174 begin
   176 begin
       
   177 {$HINTS OFF}
   175 FillChar(ammos, sizeof(ammos), 0);
   178 FillChar(ammos, sizeof(ammos), 0);
       
   179 {$HINTS ON}
   176 hhammo:= Hedgehog.Ammo;
   180 hhammo:= Hedgehog.Ammo;
   177 
   181 
   178 for slot:= 0 to cMaxSlotIndex do
   182 for slot:= 0 to cMaxSlotIndex do
   179     for ami:= 0 to cMaxSlotAmmoIndex do
   183     for ami:= 0 to cMaxSlotAmmoIndex do
   180         if hhammo^[slot, ami].Count > 0 then
   184         if hhammo^[slot, ami].Count > 0 then