trying to prevent sticking. PS. code is hard to read when drunk.
authornemo
Fri, 01 Feb 2013 20:15:22 -0500
changeset 8468 71159aa7172f
parent 8467 dc53b4b66fa0
child 8469 018da0724a93
trying to prevent sticking. PS. code is hard to read when drunk.
hedgewars/uGearsHandlersRope.pas
--- a/hedgewars/uGearsHandlersRope.pas	Fri Feb 01 18:07:43 2013 -0500
+++ b/hedgewars/uGearsHandlersRope.pas	Fri Feb 01 20:15:22 2013 -0500
@@ -164,12 +164,12 @@
     ty := HHGear^.Y;
 
     if ((Gear^.Message and gmDown) <> 0) and (Gear^.Elasticity < Gear^.Friction) then
-        if not (TestCollisionXwithXYShift(HHGear, _0, -1, hwSign(ropeDx))
+        if not (TestCollisionXwithGear(HHGear, hwSign(ropeDx))
         or ((ropeDy.QWordValue <> 0) and TestCollisionYwithXYShift(HHGear, 0, 1, hwSign(ropeDy)))) then
             Gear^.Elasticity := Gear^.Elasticity + _1_2;
 
     if ((Gear^.Message and gmUp) <> 0) and (Gear^.Elasticity > _30) then
-        if not (TestCollisionXwithXYShift(HHGear, _0, -1, -hwSign(ropeDx))
+        if not (TestCollisionXwithGear(HHGear, -hwSign(ropeDx))
         or ((ropeDy.QWordValue <> 0) and TestCollisionYwithXYShift(HHGear, 0, 1, -hwSign(ropeDy)))) then
             Gear^.Elasticity := Gear^.Elasticity - _1_2;
 
@@ -264,7 +264,7 @@
         HHGear^.dX := -_0_6 * HHGear^.dX;
         haveCollision := true
         end;
-    if TestCollisionYwithGear(HHGear, hwSign(HHGear^.dY)) <> 0 then
+    if TestCollisionYwithXYShift(HHGear, 0, 1, hwSign(HHGear^.dY)) then
         begin
         HHGear^.dY := -_0_6 * HHGear^.dY;
         haveCollision := true