hedgewars/uTeams.pas
changeset 79 29b477319854
parent 75 d2b737858ff7
child 80 3c3dc6a148ca
equal deleted inserted replaced
78:66bb79dd248d 79:29b477319854
   262       ami:= 0;
   262       ami:= 0;
   263       while (not b) and (ami < cMaxSlotAmmoIndex) do
   263       while (not b) and (ami < cMaxSlotAmmoIndex) do
   264           if (Ammo[Slot, ami].Count = 0)
   264           if (Ammo[Slot, ami].Count = 0)
   265              and (Ammo[Slot, ami + 1].Count > 0) then b:= true
   265              and (Ammo[Slot, ami + 1].Count > 0) then b:= true
   266                                                  else inc(ami);
   266                                                  else inc(ami);
   267       if b then // есть пустое место
   267       if b then // there's a free item in ammo stack
   268          begin
       
   269          Ammo[Slot, ami]:= Ammo[Slot, ami + 1]
   268          Ammo[Slot, ami]:= Ammo[Slot, ami + 1]
   270          end
       
   271     until not b;
   269     until not b;
   272 end;
   270 end;
   273 
   271 
   274 procedure OnUsedAmmo(Ammo: PHHAmmo);
   272 procedure OnUsedAmmo(Ammo: PHHAmmo);
   275 var s, a: Longword;
   273 var s, a: Longword;