fix parachute wall climbing bug
authorsheepluva
Wed, 29 Dec 2010 14:59:56 +0100
changeset 4774 d81c6e14416d
parent 4772 02370ca8e92c
child 4776 ab956d4647a4
fix parachute wall climbing bug
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Wed Dec 29 02:15:37 2010 +0100
+++ b/hedgewars/GSHandlers.inc	Wed Dec 29 14:59:56 2010 +0100
@@ -2206,14 +2206,16 @@
         exit
     end;
 
-    if not TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
-        HHGear^.X := HHGear^.X + cWindSpeed * 200;
+    HHGear^.X := HHGear^.X + cWindSpeed * 200;
 
     if (Gear^.Message and gmLeft) <> 0 then HHGear^.X := HHGear^.X - cMaxWindSpeed * 80
     else if (Gear^.Message and gmRight) <> 0 then HHGear^.X := HHGear^.X + cMaxWindSpeed * 80;
     if (Gear^.Message and gmUp) <> 0 then HHGear^.Y := HHGear^.Y - cGravity * 40
     else if (Gear^.Message and gmDown) <> 0 then HHGear^.Y := HHGear^.Y + cGravity * 40;
 
+    // don't drift into obstacles
+    if TestCollisionXwithGear(HHGear, hwSign(HHGear^.dX)) then
+        HHGear^.X := HHGear^.X - int2hwFloat(hwSign(HHGear^.dX));
     HHGear^.Y := HHGear^.Y + cGravity * 100;
     Gear^.X := HHGear^.X;
     Gear^.Y := HHGear^.Y