hedgewars/uTeams.pas
changeset 70 82d93eeecebe
parent 64 9df467527ae5
child 72 aeb2ac1878dc
--- a/hedgewars/uTeams.pas	Tue Jun 20 21:22:15 2006 +0000
+++ b/hedgewars/uTeams.pas	Fri Jun 23 20:02:41 2006 +0000
@@ -73,7 +73,7 @@
     TeamsList: PTeam = nil;
 
 function AddTeam: PTeam;
-procedure ApplyAmmoChanges(Hedgehog: PHedgehog);
+procedure ApplyAmmoChanges(var Hedgehog: THedgehog);
 procedure SwitchHedgehog;
 procedure InitTeams;
 procedure OnUsedAmmo(Ammo: PHHAmmo);
@@ -129,7 +129,7 @@
 cWindSpeed:= (GetRandom * 2 - 1) * cMaxWindSpeed;
 AddGear(0, 0, gtActionTimer, gtsSmoothWindCh).Tag:= round(72 * cWindSpeed / cMaxWindSpeed);
 {$IFDEF DEBUGFILE}AddFileLog('Wind = '+FloatToStr(cWindSpeed));{$ENDIF}
-ApplyAmmoChanges(@CurrentTeam.Hedgehogs[CurrentTeam.CurrHedgehog]);
+ApplyAmmoChanges(CurrentTeam.Hedgehogs[CurrentTeam.CurrHedgehog]);
 TurnTimeLeft:= cHedgehogTurnTime
 end;
 
@@ -219,10 +219,10 @@
 RecountAllTeamsHealth
 end;
 
-procedure ApplyAmmoChanges(Hedgehog: PHedgehog);
+procedure ApplyAmmoChanges(var Hedgehog: THedgehog);
 var s: shortstring;
 begin
-with Hedgehog^ do
+with Hedgehog do
      begin
      if Ammo[CurSlot, CurAmmo].Count = 0 then
         begin
@@ -259,12 +259,12 @@
       b:= false;
       ami:= 0;
       while (not b) and (ami < cMaxSlotAmmoIndex) do
-          if (Ammo[slot, ami].Count = 0)
-             and (Ammo[slot, ami + 1].Count > 0) then b:= true
+          if (Ammo[Slot, ami].Count = 0)
+             and (Ammo[Slot, ami + 1].Count > 0) then b:= true
                                                  else inc(ami);
       if b then // есть пустое место
          begin
-         Ammo[slot, ami]:= Ammo[slot, ami + 1]
+         Ammo[Slot, ami]:= Ammo[Slot, ami + 1]
          end
     until not b;
 end;