Fix bug with holding switch tool
authorunc0rr
Thu, 22 May 2008 17:25:12 +0000
changeset 944 9299c0ebfdbc
parent 943 a0c36a0b3ad9
child 945 4ead9cde4e14
Fix bug with holding switch tool
hedgewars/uTeams.pas
--- a/hedgewars/uTeams.pas	Wed May 21 20:22:51 2008 +0000
+++ b/hedgewars/uTeams.pas	Thu May 22 17:25:12 2008 +0000
@@ -140,13 +140,13 @@
 TargetPoint.X:= NoPointX;
 TryDo(CurrentTeam <> nil, 'nil Team', true);
 
-with CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog] do
+with CurrentHedgehog^ do
      if Gear <> nil then
         begin
         AttacksNum:= 0;
         Gear^.Message:= 0;
         Gear^.Z:= cHHZ;
-        SwitchNotHoldedAmmo(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
+        SwitchNotHoldedAmmo(CurrentHedgehog^);
         RemoveGearFromList(Gear);
         InsertGearToList(Gear)
         end;
@@ -170,6 +170,7 @@
 until CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil;
 
 CurrentHedgehog:= @(CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);
+SwitchNotHoldedAmmo(CurrentHedgehog^);
 with CurrentHedgehog^ do
      begin
      with Gear^ do