hedgewars/uGearsHandlersRope.pas
changeset 9683 a342837fc875
parent 9681 69a1e18330c0
child 9706 5178d2263521
--- a/hedgewars/uGearsHandlersRope.pas	Thu Nov 07 22:23:34 2013 -0500
+++ b/hedgewars/uGearsHandlersRope.pas	Thu Nov 07 23:08:28 2013 -0500
@@ -168,7 +168,7 @@
             cd:= 1;
 
         // apply gravity if there is no obstacle
-        if not (TestCollisionXwithXYShift(HHGear, _1*cd, 0, cd, true)) then
+        if not (TestCollisionXwithXYShift(HHGear, _2*cd, 0, cd, true)) then
             HHGear^.dY := HHGear^.dY + cGravity * 16;
 
         if (GameFlags and gfMoreWind) <> 0 then
@@ -195,13 +195,11 @@
     if ((Gear^.Message and gmDown) <> 0) and (Gear^.Elasticity < Gear^.Friction) then
         if not (TestCollisionXwithXYShift(HHGear, _2*hwSign(ropeDx), 0, hwSign(ropeDx), true)
         or ((ropeDy.QWordValue <> 0) and TestCollisionYwithXYShift(HHGear, 0, 1*hwSign(ropeDy), hwSign(ropeDy)))) then
-        //or TestCollisionXwithXYShift(HHGear, _1*hwSign(ropeDx), 0, hwSign(ropeDx), true)) then
             Gear^.Elasticity := Gear^.Elasticity + _1_2;
 
     if ((Gear^.Message and gmUp) <> 0) and (Gear^.Elasticity > _30) then
         if not (TestCollisionXwithXYShift(HHGear, -_2*hwSign(ropeDx), 0, -hwSign(ropeDx), true)
         or ((ropeDy.QWordValue <> 0) and TestCollisionYwithXYShift(HHGear, 0, 1*-hwSign(ropeDy), -hwSign(ropeDy)))) then
-        //or TestCollisionXwithXYShift(HHGear, -_1*hwSign(ropeDx), 0, -hwSign(ropeDx))) then
             Gear^.Elasticity := Gear^.Elasticity - _1_2;
 
     HHGear^.X := Gear^.X + mdX * Gear^.Elasticity;
@@ -317,7 +315,7 @@
             end;
 
     haveCollision := false;
-    if TestCollisionXwithXYShift(HHGear, _1*hwSign(HHGear^.dX), 0, hwSign(HHGear^.dX), true) then
+    if TestCollisionXwithXYShift(HHGear, _2*hwSign(HHGear^.dX), 0, hwSign(HHGear^.dX), true) then
         begin
         HHGear^.dX := -_0_6 * HHGear^.dX;
         haveCollision := true