this might possibly appease the shoppa players
authornemo
Thu, 31 Jan 2013 21:28:08 -0500
changeset 8462 19b1de9423ab
parent 8460 75e771c3c039
child 8464 c708b4f5cffc
this might possibly appease the shoppa players
hedgewars/uGearsHandlersRope.pas
--- a/hedgewars/uGearsHandlersRope.pas	Tue Jan 29 13:45:31 2013 -0500
+++ b/hedgewars/uGearsHandlersRope.pas	Thu Jan 31 21:28:08 2013 -0500
@@ -164,13 +164,13 @@
     ty := HHGear^.Y;
 
     if ((Gear^.Message and gmDown) <> 0) and (Gear^.Elasticity < Gear^.Friction) then
-        if not (TestCollisionXwithGear(HHGear, hwSign(ropeDx))
-        or (TestCollisionYwithGear(HHGear, hwSign(ropeDy)) <> 0)) then
+        if not (TestCollisionXwithXYShift(HHGear, _0, -1, 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 (TestCollisionXwithGear(HHGear, -hwSign(ropeDx))
-        or (TestCollisionYwithGear(HHGear, -hwSign(ropeDy)) <> 0)) then
+        if not (TestCollisionXwithXYShift(HHGear, _0, -1, -hwSign(ropeDx))
+        or ((ropeDy.QWordValue <> 0) and TestCollisionYwithXYShift(HHGear, 0, 1, -hwSign(ropeDy)))) then
             Gear^.Elasticity := Gear^.Elasticity - _1_2;
 
     HHGear^.X := Gear^.X + mdX * Gear^.Elasticity;