hedgewars/uAmmos.pas
changeset 547 b81a055f2d06
parent 545 f527450337c1
child 553 5478386d935f
equal deleted inserted replaced
546:0e7cc3fb05cd 547:b81a055f2d06
    77 TryDo(num < StoreCnt, 'Invalid store number', true);
    77 TryDo(num < StoreCnt, 'Invalid store number', true);
    78 exit(StoresList[num])
    78 exit(StoresList[num])
    79 end;
    79 end;
    80 
    80 
    81 procedure AssignStores;
    81 procedure AssignStores;
    82 var tteam: PTeam;
    82 var t: LongInt;
    83     i: Longword;
    83     i: Longword;
    84 begin
    84 begin
    85 tteam:= TeamsList;
    85 for t:= 0 to Pred(TeamsCount) do
    86 while tteam <> nil do
    86    with TeamsArray[t]^ do
    87       begin
    87       begin
    88       for i:= 0 to cMaxHHIndex do
    88       for i:= 0 to cMaxHHIndex do
    89           if tteam^.Hedgehogs[i].Gear <> nil then
    89           if Hedgehogs[i].Gear <> nil then
    90              tteam^.Hedgehogs[i].Ammo:= GetAmmoByNum(tteam^.Hedgehogs[i].AmmoStore);
    90              Hedgehogs[i].Ammo:= GetAmmoByNum(Hedgehogs[i].AmmoStore);
    91       tteam:= tteam^.Next
       
    92       end
    91       end
    93 end;
    92 end;
    94 
    93 
    95 procedure AddAmmo(Hedgehog: pointer; ammo: TAmmoType);
    94 procedure AddAmmo(Hedgehog: pointer; ammo: TAmmoType);
    96 var ammos: TAmmoCounts;
    95 var ammos: TAmmoCounts;