hedgewars/GSHandlers.inc
changeset 7341 d70478d265ec
parent 7339 5984b749ad9b
child 7370 d50b874e7ee8
--- a/hedgewars/GSHandlers.inc	Wed Jul 04 12:41:47 2012 -0400
+++ b/hedgewars/GSHandlers.inc	Thu Jul 05 20:53:55 2012 +0400
@@ -2750,16 +2750,17 @@
 procedure doStepSwitcherWork(Gear: PGear);
 var 
     HHGear: PGear;
+    hedgehog: PHedgehog;
     State: Longword;
 begin
     AllInactive := false;
 
     if ((Gear^.Message and (not gmSwitch)) <> 0) or (TurnTimeLeft = 0) then
         begin
-        HHGear := Gear^.Hedgehog^.Gear;
+        hedgehog := Gear^.Hedgehog;
         //Msg := Gear^.Message and (not gmSwitch);
         DeleteGear(Gear);
-        ApplyAmmoChanges(HHGear^.Hedgehog^);
+        ApplyAmmoChanges(hedgehog^);
 
         HHGear := CurrentHedgehog^.Gear;
         ApplyAmmoChanges(HHGear^.Hedgehog^);