hedgewars/uGearsHandlersRope.pas
changeset 7602 a620319d377e
parent 7601 c96ff1a053d0
child 7604 c143c942b5fe
--- a/hedgewars/uGearsHandlersRope.pas	Sat Aug 25 15:04:24 2012 -0400
+++ b/hedgewars/uGearsHandlersRope.pas	Sat Aug 25 18:22:15 2012 -0400
@@ -76,8 +76,8 @@
 procedure RopeDeleteMe(Gear, HHGear: PGear);
 begin
     PlaySound(sndRopeRelease);
-    HHGear^.dX.QWordValue:= HHGear^.dX.QWordValue shr 3;
-    HHGear^.dY.QWordValue:= HHGear^.dY.QWordValue shr 3;
+    HHGear^.dX.QWordValue:= HHGear^.dX.QWordValue div Gear^.stepFreq;
+    HHGear^.dY.QWordValue:= HHGear^.dY.QWordValue div Gear^.stepFreq;
     with HHGear^ do
         begin
         Message := Message and (not gmAttack);
@@ -89,8 +89,6 @@
 procedure RopeWaitCollision(Gear, HHGear: PGear);
 begin
     PlaySound(sndRopeRelease);
-    HHGear^.dX.QWordValue:= HHGear^.dX.QWordValue shr 3;
-    HHGear^.dY.QWordValue:= HHGear^.dY.QWordValue shr 3;
     with HHGear^ do
         begin
         Message := Message and (not gmAttack);
@@ -98,7 +96,10 @@
         end;
     RopePoints.Count := 0;
     Gear^.Elasticity := _0;
-    Gear^.doStep := @doStepRopeAfterAttack
+    Gear^.doStep := @doStepRopeAfterAttack;
+    HHGear^.dX.QWordValue:= HHGear^.dX.QWordValue div Gear^.stepFreq;
+    HHGear^.dY.QWordValue:= HHGear^.dY.QWordValue div Gear^.stepFreq;
+    Gear^.stepFreq := 1
 end;
 
 procedure doStepRopeWork(Gear: PGear);
@@ -411,6 +412,7 @@
                 Gear^.Y := Gear^.Y + ty;
                 Gear^.Elasticity := tt;
                 Gear^.doStep := @doStepRopeWork;
+                Gear^.stepFreq:= 8;
                 PlaySound(sndRopeAttach);
                 with HHGear^ do
                     begin
@@ -441,6 +443,7 @@
     else
         begin
         Gear^.doStep := @doStepRopeWork;
+        Gear^.stepFreq:= 8;
         PlaySound(sndRopeAttach);
         with HHGear^ do
             begin