falling hogs using rope were ignoring a few things (for example taking damage from rubber)
authornemo
Sun, 25 Feb 2018 18:54:51 -0500
changeset 13069 ba7ac61c7668
parent 13068 6369d148cfff
child 13070 53cbf7aea5f0
falling hogs using rope were ignoring a few things (for example taking damage from rubber)
.hgignore
hedgewars/uGearsHandlersRope.pas
--- a/.hgignore	Sun Feb 25 18:57:30 2018 +0100
+++ b/.hgignore	Sun Feb 25 18:54:51 2018 -0500
@@ -26,7 +26,7 @@
 tools/cmake_uninstall.cmake
 install_manifest.txt
 .DS_Store
-*.swp
+*.sw?
 *.orig
 vittorio.*
 project_files/HedgewarsMobile/Data/
--- a/hedgewars/uGearsHandlersRope.pas	Sun Feb 25 18:57:30 2018 +0100
+++ b/hedgewars/uGearsHandlersRope.pas	Sun Feb 25 18:54:51 2018 -0500
@@ -26,7 +26,7 @@
 
 implementation
 uses uConsts, uFloat, uCollisions, uVariables, uGearsList, uSound, uGearsUtils,
-    uAmmos, uDebug, uUtils, uGearsHedgehog, uGearsRender;
+    uAmmos, uDebug, uUtils, uGearsHedgehog, uGearsRender, uGearsHandlersMess;
 
 const
     IsNilHHFatal = false;
@@ -462,28 +462,10 @@
 
     if (HHGear^.State and gstMoving) <> 0 then
         begin
-        if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) <> 0 then
-            SetLittle(HHGear^.dX);
-        if HHGear^.dY.isNegative and (TestCollisionYwithGear(HHGear, -1) <> 0) then
-            HHGear^.dY := _0;
-
-        HHGear^.X := HHGear^.X + HHGear^.dX;
+        doStepHedgehogMoving(HHGear);
         Gear^.X := Gear^.X + HHGear^.dX;
+        Gear^.Y := Gear^.Y + HHGear^.dY;
 
-        if TestCollisionYwithGear(HHGear, 1) <> 0 then
-            begin
-            CheckHHDamage(HHGear);
-            HHGear^.dY := _0
-            //HHGear^.State:= HHGear^.State and (not (gstHHJumping or gstHHHJump));
-            end
-        else
-            begin
-            HHGear^.Y := HHGear^.Y + HHGear^.dY;
-            Gear^.Y := Gear^.Y + HHGear^.dY;
-            HHGear^.dY := HHGear^.dY + cGravity;
-            if (GameFlags and gfMoreWind) <> 0 then
-                HHGear^.dX := HHGear^.dX + cWindSpeed / HHGear^.Density
-            end;
 
         tt := Gear^.Elasticity;
         tx := _0;