hedgewars/uTeams.pas
changeset 602 f7628ebfccde
parent 601 78a68cc4d846
child 689 f4ec46c48ed2
--- a/hedgewars/uTeams.pas	Thu Sep 20 20:00:10 2007 +0000
+++ b/hedgewars/uTeams.pas	Fri Sep 21 18:55:44 2007 +0000
@@ -71,6 +71,7 @@
              end;
 
 var CurrentTeam: PTeam = nil;
+    CurrentHedgehog: PHedgehog = nil;
     TeamsArray: array[0..Pred(cMaxTeams)] of PTeam;
     TeamsCount: Longword = 0;
     ClansArray: array[0..Pred(cMaxTeams)] of PClan;
@@ -169,7 +170,8 @@
     until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) or (PrevTeam = CurrTeam);
 until CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil;
 
-with CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog] do
+CurrentHedgehog:= @(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
+with CurrentHedgehog^ do
      begin
      with Gear^ do
           begin
@@ -187,7 +189,7 @@
 g:= AddGear(0, 0, gtATSmoothWindCh, 0, _0, _0, 1);
 g^.Tag:= hwRound(cWindSpeed * 72 / cMaxWindSpeed);
 {$IFDEF DEBUGFILE}AddFileLog('Wind = '+FloatToStr(cWindSpeed));{$ENDIF}
-ApplyAmmoChanges(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
+ApplyAmmoChanges(CurrentHedgehog^);
 if CurrentTeam^.ExtDriven then SetDefaultBinds
                           else SetBinds(CurrentTeam^.Binds);
 bShowFinger:= true;