hedgewars/HHHandlers.inc
changeset 610 9b5a6200f667
parent 602 f7628ebfccde
child 614 0e04504bc140
--- a/hedgewars/HHHandlers.inc	Sat Sep 22 16:19:11 2007 +0000
+++ b/hedgewars/HHHandlers.inc	Sat Sep 22 17:04:28 2007 +0000
@@ -184,8 +184,12 @@
    if (Gear^.Message and gm_Right )<>0 then Gear^.dX:=  cLittle else exit;
 
    StepTicks:= cHHStepTicks;
-   if PrevdX <> hwSign(Gear^.dX) then exit;
-   DeleteCI(Gear); // after exit!!    ^^^^
+   if PrevdX <> hwSign(Gear^.dX) then
+      begin
+      FollowGear:= Gear;
+      exit
+      end;
+   DeleteCI(Gear); // must be after exit!! (see previous line)
    
    PHedgehog(Gear^.Hedgehog)^.visStepPos:= (PHedgehog(Gear^.Hedgehog)^.visStepPos + 1) and 7;
    if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then