my turn to merge
authorkoda
Thu, 21 Oct 2010 00:45:58 +0200
changeset 3987 fd67be12fdbc
parent 3984 d92509c2f255 (current diff)
parent 3986 99178ffb817d (diff)
child 3988 044cc945b2f8
my turn to merge
--- a/QTfrontend/sdlkeys.h	Thu Oct 21 00:41:41 2010 +0200
+++ b/QTfrontend/sdlkeys.h	Thu Oct 21 00:45:58 2010 +0200
@@ -39,7 +39,7 @@
     {")", ")"},
     {"*", "*"},
     {"+", "+"},
-    {", ", ", "},
+    {",", ","},
     {"-", "-"},
     {".", "."},
     {"/", "/"},
--- a/hedgewars/GSHandlers.inc	Thu Oct 21 00:41:41 2010 +0200
+++ b/hedgewars/GSHandlers.inc	Thu Oct 21 00:45:58 2010 +0200
@@ -1125,11 +1125,11 @@
 
     if ((HHGear^.State and gstHHDriven) = 0)
        or (CheckGearDrowning(HHGear)) then
-    begin
+        begin
         PlaySound(sndRopeRelease);
         DeleteMe;
         exit
-    end;
+        end;
 
     if (Gear^.Message and gmLeft  <> 0) then HHGear^.dX := HHGear^.dX - _0_0002
     else
@@ -1184,30 +1184,29 @@
     ty := mdY * _0_3;
 
     while len > _3 do
-    begin
+        begin
         lx := hwRound(nx);
         ly := hwRound(ny);
-        if ((ly and LAND_HEIGHT_MASK) = 0) and ((lx and LAND_WIDTH_MASK) = 0) and (Land[ly, lx] <> 0
-           ) then
-        begin
+        if ((ly and LAND_HEIGHT_MASK) = 0) and ((lx and LAND_WIDTH_MASK) = 0) and (Land[ly, lx] <> 0) then
+            begin
             ny := _1 / Distance(ropeDx, ropeDy);
             // old rope pos
             nx := ropeDx * ny;
             ny := ropeDy * ny;
 
             with RopePoints.ar[RopePoints.Count] do
-            begin
+                begin
                 X := Gear^.X;
                 Y := Gear^.Y;
                 if RopePoints.Count = 0 then RopePoints.HookAngle := DxDy2Angle(Gear^.dY, Gear^.dX);
                 b := (nx * HHGear^.dY) > (ny * HHGear^.dX);
                 dLen := len
-            end;
+                end;
             with RopePoints.rounded[RopePoints.Count] do
-            begin
+                begin
                 X := hwRound(Gear^.X);
                 Y := hwRound(Gear^.Y);
-            end;
+                end;
 
             Gear^.X := Gear^.X + nx * len;
             Gear^.Y := Gear^.Y + ny * len;
@@ -1217,23 +1216,24 @@
             Gear^.Friction := Gear^.Friction - len;
             haveDivided := true;
             break
-        end;
+            end;
         nx := nx - tx;
         ny := ny - ty;
+        lx := hwRound(nx);
+        ly := hwRound(ny);
         // len := len - _0_3 // should be the same as increase step
         len.QWordValue := len.QWordValue - _0_3.QWordValue;
-    end;
+        end;
 
     if not haveDivided then
         if RopePoints.Count > 0 then // check whether the last dividing point could be removed
-        begin
+            begin
             tx := RopePoints.ar[Pred(RopePoints.Count)].X;
             ty := RopePoints.ar[Pred(RopePoints.Count)].Y;
             mdX := tx - Gear^.X;
             mdY := ty - Gear^.Y;
-            if RopePoints.ar[Pred(RopePoints.Count)].b xor (mdX * (ty - HHGear^.Y) > (tx - HHGear^.X
-               ) * mdY) then
-            begin
+            if RopePoints.ar[Pred(RopePoints.Count)].b xor (mdX * (ty - HHGear^.Y) > (tx - HHGear^.X) * mdY) then
+                begin
                 dec(RopePoints.Count);
                 Gear^.X := RopePoints.ar[RopePoints.Count].X;
                 Gear^.Y := RopePoints.ar[RopePoints.Count].Y;
@@ -1247,48 +1247,48 @@
 
                 HHGear^.X := Gear^.X - mdX * Gear^.Elasticity;
                 HHGear^.Y := Gear^.Y - mdY * Gear^.Elasticity;
-            end
-        end;
+                end
+            end;
 
     haveCollision := false;
     if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
-    begin
+        begin
         HHGear^.dX := -_0_6 * HHGear^.dX;
         haveCollision := true
-    end;
+        end;
     if TestCollisionYwithGear(HHGear, hwSign(HHGear^.dY)) then
-    begin
+        begin
         HHGear^.dY := -_0_6 * HHGear^.dY;
         haveCollision := true
-    end;
+        end;
 
     if haveCollision
        and (Gear^.Message and (gmLeft or gmRight) <> 0)
        and (Gear^.Message and (gmUp or gmDown) <> 0) then
-    begin
+        begin
         HHGear^.dX := SignAs(hwAbs(HHGear^.dX) + _0_2, HHGear^.dX);
         HHGear^.dY := SignAs(hwAbs(HHGear^.dY) + _0_2, HHGear^.dY)
-    end;
+        end;
 
     len := hwSqr(HHGear^.dX) + hwSqr(HHGear^.dY);
     if len > _0_64 then
-    begin
+        begin
         len := _0_8 / hwSqrt(len);
         HHGear^.dX := HHGear^.dX * len;
         HHGear^.dY := HHGear^.dY * len;
-    end;
+        end;
 
 
     if (Gear^.Message and gmAttack) <> 0 then
         if (Gear^.State and gsttmpFlag) <> 0 then
             with PHedgehog(Gear^.Hedgehog)^ do
-            begin
+                begin
                 PlaySound(sndRopeRelease);
                 if CurAmmoType <> amParachute then
                     WaitCollision
                 else
                     DeleteMe
-            end
+                end
     else
     else
         if (Gear^.State and gsttmpFlag) = 0 then