hedgewars/HHHandlers.inc
changeset 517 ba560c17c24c
parent 513 69e06d710d46
child 518 d48d8c0a546d
equal deleted inserted replaced
516:f682e134ac2e 517:ba560c17c24c
   181       end;
   181       end;
   182 
   182 
   183    PrevdX:= hwSign(Gear^.dX);
   183    PrevdX:= hwSign(Gear^.dX);
   184    if (Gear^.Message and gm_Left  )<>0 then Gear^.dX:= -cLittle else
   184    if (Gear^.Message and gm_Left  )<>0 then Gear^.dX:= -cLittle else
   185    if (Gear^.Message and gm_Right )<>0 then Gear^.dX:=  cLittle else exit;
   185    if (Gear^.Message and gm_Right )<>0 then Gear^.dX:=  cLittle else exit;
   186    DeleteCI(Gear);
       
   187 
   186 
   188    StepTicks:= cHHStepTicks;
   187    StepTicks:= cHHStepTicks;
   189    if PrevdX <> hwSign(Gear^.dX) then exit;
   188    if PrevdX <> hwSign(Gear^.dX) then exit;
       
   189    DeleteCI(Gear); // after exit!!    ^^^^
       
   190    
   190    PHedgehog(Gear^.Hedgehog)^.visStepPos:= (PHedgehog(Gear^.Hedgehog)^.visStepPos + 1) and 7;
   191    PHedgehog(Gear^.Hedgehog)^.visStepPos:= (PHedgehog(Gear^.Hedgehog)^.visStepPos + 1) and 7;
   191    if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then
   192    if TestCollisionXwithGear(Gear, hwSign(Gear^.dX)) then
   192       begin
   193       begin
   193       if not (TestCollisionXwithXYShift(Gear, _0, -6, hwSign(Gear^.dX))
   194       if not (TestCollisionXwithXYShift(Gear, _0, -6, hwSign(Gear^.dX))
   194          or TestCollisionYwithGear(Gear, -1)) then Gear^.Y:= Gear^.Y - _1;
   195          or TestCollisionYwithGear(Gear, -1)) then Gear^.Y:= Gear^.Y - _1;