hedgewars/GSHandlers.inc
changeset 6002 7f790689205c
parent 5977 0b1bfdd95310
child 6011 519f8a58c021
--- a/hedgewars/GSHandlers.inc	Sat Sep 24 00:54:47 2011 +0200
+++ b/hedgewars/GSHandlers.inc	Sat Sep 24 01:41:03 2011 +0200
@@ -1503,9 +1503,11 @@
         exit
         end;
 
-    if (Gear^.Message and gmLeft  <> 0) then HHGear^.dX := HHGear^.dX - _0_0002
-    else
-        if (Gear^.Message and gmRight <> 0) then HHGear^.dX := HHGear^.dX + _0_0002;
+    if (Gear^.Message and gmLeft  <> 0) and not TestCollisionXwithGear(HHGear, -1) then
+        HHGear^.dX := HHGear^.dX - _0_0002;
+
+    if (Gear^.Message and gmRight <> 0) and not TestCollisionXwithGear(HHGear,  1) then
+        HHGear^.dX := HHGear^.dX + _0_0002;
 
     // vector between hedgehog and rope attaching point
     ropeDx := HHGear^.X - Gear^.X;