hedgewars/uAmmos.pas
changeset 3955 d14ecff9502b
parent 3951 c9a63db3e603
child 3960 ada50f8d4186
equal deleted inserted replaced
3954:ae3583ad6ea9 3955:d14ecff9502b
   416     ammoReinforcement:= s;
   416     ammoReinforcement:= s;
   417 end;
   417 end;
   418 
   418 
   419 // Restore indefinitely disabled weapons and initial weapon counts.  Only used for hog placement right now
   419 // Restore indefinitely disabled weapons and initial weapon counts.  Only used for hog placement right now
   420 procedure ResetWeapons;
   420 procedure ResetWeapons;
   421 var i, slot, a: Longword;
   421 var i, t: Longword;
   422     t: TAmmoType;
   422     a: TAmmoType;
   423 begin
   423 begin
   424 for i:= 0 to Pred(StoreCnt) do
   424 for t:= 0 to Pred(TeamsCount) do
   425     for slot:= 0 to cMaxSlotIndex do
   425    with TeamsArray[t]^ do
   426         begin
   426       for i:= 0 to cMaxHHIndex do
   427         for a:= 0 to cMaxSlotAmmoIndex do
   427           if Hedgehogs[i].Gear <> nil then
   428             with StoresList[i]^[slot, a] do
   428              FillAmmoStore(Hedgehogs[i].Ammo, InitialCounts[Hedgehogs[i].AmmoStore]);
   429                 if AmmoType <> amNothing then Count:= InitialCounts[i][AmmoType];
   429 
   430 
   430 for a:= Low(TAmmoType) to High(TAmmoType) do
   431         PackAmmo(StoresList[i], slot)
   431     if Ammoz[a].SkipTurns >= 10000 then dec(Ammoz[a].SkipTurns,10000)
   432         end;
       
   433 for t:= Low(TAmmoType) to High(TAmmoType) do
       
   434     if Ammoz[t].SkipTurns >= 10000 then dec(Ammoz[t].SkipTurns,10000);
       
   435 end;
   432 end;
   436 
   433 
   437 procedure initModule;
   434 procedure initModule;
   438 begin
   435 begin
   439     shoppa:= false;
   436     shoppa:= false;