hedgewars/uGearsHandlersRope.pas
changeset 7606 adb1198ade36
parent 7605 10e88fbb5fdb
child 7607 0cae2a3e562c
equal deleted inserted replaced
7605:10e88fbb5fdb 7606:adb1198ade36
    87             end
    87             end
    88         until (i = 8) or not stuck;
    88         until (i = 8) or not stuck;
    89         HHGear^.Y:= HHGear^.Y-int2hwFloat(pred(i));
    89         HHGear^.Y:= HHGear^.Y-int2hwFloat(pred(i));
    90         // experiment in simulating something the shoppa players apparently expect
    90         // experiment in simulating something the shoppa players apparently expect
    91         if Gear^.Message and gmDown <> 0 then
    91         if Gear^.Message and gmDown <> 0 then
    92             HHGear^.dY.QWordValue:= 0
    92             HHGear^.dY.QWordValue:= 0;
       
    93         if Gear^.Message and gmRight <> 0 then
       
    94             HHGear^.dX.isNegative:= false
       
    95         else if Gear^.Message and gmLeft <> 0 then
       
    96             HHGear^.dX.isNegative:= true
    93         end
    97         end
    94     else if (TestCollisionYwithGear(HHGear, -1) <> 0) and (TestCollisionYwithGear(HHGear, 1) = 0) then
    98     else if (TestCollisionYwithGear(HHGear, -1) <> 0) and (TestCollisionYwithGear(HHGear, 1) = 0) then
    95         begin
    99         begin
    96         i:= -1;
   100         i:= -1;
    97         repeat
   101         repeat
   100             stuck:= TestCollisionYwithGear(HHGear, i) <> 0
   104             stuck:= TestCollisionYwithGear(HHGear, i) <> 0
   101             end
   105             end
   102         until (i = -8) or not stuck;
   106         until (i = -8) or not stuck;
   103         HHGear^.Y:= HHGear^.Y-int2hwFloat(succ(i));
   107         HHGear^.Y:= HHGear^.Y-int2hwFloat(succ(i));
   104         if Gear^.Message and gmDown <> 0 then
   108         if Gear^.Message and gmDown <> 0 then
   105             HHGear^.dY.QWordValue:= 0
   109             HHGear^.dY.QWordValue:= 0;
       
   110         if Gear^.Message and gmRight <> 0 then
       
   111             HHGear^.dX.isNegative:= false
       
   112         else if Gear^.Message and gmLeft <> 0 then
       
   113             HHGear^.dX.isNegative:= true
   106         end;
   114         end;
   107     if TestCollisionXwithGear(HHGear, 1) and not TestCollisionXwithGear(HHGear, -1) then
   115     if TestCollisionXwithGear(HHGear, 1) and not TestCollisionXwithGear(HHGear, -1) then
   108         begin
   116         begin
   109         i:= 1;
   117         i:= 1;
   110         repeat
   118         repeat