Hack to try and appease the shoppa players
authornemo
Sat, 25 Aug 2012 20:15:19 -0400
changeset 7604 c143c942b5fe
parent 7603 e9c3c67b5dfd
child 7605 10e88fbb5fdb
Hack to try and appease the shoppa players
hedgewars/uGearsHandlersRope.pas
--- a/hedgewars/uGearsHandlersRope.pas	Sat Aug 25 18:35:59 2012 -0400
+++ b/hedgewars/uGearsHandlersRope.pas	Sat Aug 25 20:15:19 2012 -0400
@@ -87,6 +87,8 @@
 end;
 
 procedure RopeWaitCollision(Gear, HHGear: PGear);
+var i: LongInt;
+    stuck: Boolean;
 begin
     PlaySound(sndRopeRelease);
     with HHGear^ do
@@ -94,6 +96,17 @@
         Message := Message and (not gmAttack);
         State := State or gstMoving;
         end;
+    if (TestCollisionYwithGear(HHGear, 1) <> 0) and (TestCollisionYwithGear(HHGear, -1) = 0) then
+        begin
+        i:= 1;
+        repeat
+            begin
+            inc(i);
+            stuck:= TestCollisionYwithGear(HHGear, i) <> 0
+            end
+        until (i = 8) or not stuck;
+        HHGear^.Y:= HHGear^.Y-int2hwFloat(pred(i))
+        end;
     RopePoints.Count := 0;
     Gear^.Elasticity := _0;
     Gear^.doStep := @doStepRopeAfterAttack;
@@ -168,6 +181,8 @@
             Gear^.Elasticity := Gear^.Elasticity - _2_4
     else haveCollision:= true;
 
+(*
+I am not so sure this is useful. Disabling
     if haveCollision then
         begin
         if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) and not TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
@@ -175,6 +190,7 @@
         if (TestCollisionYwithGear(HHGear, hwSign(HHGear^.dY)) <> 0) and (TestCollisionYwithGear(HHGear, -hwSign(HHGear^.dY)) = 0) then
             HHGear^.dY.isNegative:= not HHGear^.dY.isNegative;
         end;
+*)
 
     mdX := ropeDx + HHGear^.dX;
     mdY := ropeDy + HHGear^.dY;