hedgewars/uGearsHandlersRope.pas
changeset 7596 2c12b8cbd002
parent 7595 bbac3c0f0c68
child 7601 c96ff1a053d0
equal deleted inserted replaced
7595:bbac3c0f0c68 7596:2c12b8cbd002
   170     if haveCollision then
   170     if haveCollision then
   171         begin
   171         begin
   172         if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) and not TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
   172         if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) and not TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
   173             HHGear^.dX.isNegative:= not HHGear^.dX.isNegative;
   173             HHGear^.dX.isNegative:= not HHGear^.dX.isNegative;
   174         if (TestCollisionYwithGear(HHGear, hwSign(HHGear^.dY)) <> 0) and (TestCollisionYwithGear(HHGear, -hwSign(HHGear^.dY)) = 0) then
   174         if (TestCollisionYwithGear(HHGear, hwSign(HHGear^.dY)) <> 0) and (TestCollisionYwithGear(HHGear, -hwSign(HHGear^.dY)) = 0) then
   175             HHGear^.dY.isNegative:= not HHGear^.dX.isNegative;
   175             HHGear^.dY.isNegative:= not HHGear^.dY.isNegative;
   176         end;
   176         end;
   177 
   177 
   178     mdX := ropeDx + HHGear^.dX;
   178     mdX := ropeDx + HHGear^.dX;
   179     mdY := ropeDy + HHGear^.dY;
   179     mdY := ropeDy + HHGear^.dY;
   180     len := _1 / Distance(mdX, mdY);
   180     len := _1 / Distance(mdX, mdY);