fix for issue 376 (embedding barrels in ceiling)
authorsheepluva
Mon, 03 Sep 2012 20:46:34 +0200
changeset 7661 3046ad5b361e
parent 7660 8398faa1e628
child 7662 35d895dcd6f7
fix for issue #376 (embedding barrels in ceiling)
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Mon Sep 03 14:08:01 2012 -0400
+++ b/hedgewars/GSHandlers.inc	Mon Sep 03 20:46:34 2012 +0200
@@ -1771,14 +1771,17 @@
     or (TestCollisionYwithGear(Gear, 1) = 0) then
         begin
         AllInactive := false;
+
         Gear^.dY := Gear^.dY + cGravity;
+
+        if (Gear^.dY.isNegative) and (TestCollisionYwithGear(Gear, -1) <> 0) then
+            Gear^.dY := _0;
+
         Gear^.Y := Gear^.Y + Gear^.dY;
+
         if (not Gear^.dY.isNegative) and (Gear^.dY > _0_001) then
             SetAllHHToActive;
-            
-        if (Gear^.dY.isNegative) and (TestCollisionYwithGear(Gear, -1) <> 0) then
-            Gear^.dY := _0;
-            
+
         if (not Gear^.dY.isNegative) and (TestCollisionYwithGear(Gear, 1) <> 0) then
             begin
             if (Gear^.dY > _0_2) and (k = gtExplosives) then