# HG changeset patch
# User unc0rr
# Date 1211477112 0
# Node ID 9299c0ebfdbc75af5465e32ded6f01658b88bdf2
# Parent  a0c36a0b3ad9b7997603b1808bedc6e99e74ab8c
Fix bug with holding switch tool

diff -r a0c36a0b3ad9 -r 9299c0ebfdbc 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