Fix hog turning around when blowtorching through wrap world edge
authorWuzzy <Wuzzy2@mail.ru>
Mon, 06 Aug 2018 19:05:08 +0200
changeset 13611 65a10215ba43
parent 13610 f1b6070a6e14
child 13612 7b4a56157bc5
Fix hog turning around when blowtorching through wrap world edge
hedgewars/uGearsHedgehog.pas
--- a/hedgewars/uGearsHedgehog.pas	Mon Aug 06 18:55:22 2018 +0200
+++ b/hedgewars/uGearsHedgehog.pas	Mon Aug 06 19:05:08 2018 +0200
@@ -1565,14 +1565,15 @@
        CurAmmoGear^.PortalCounter:= 1;
     if (WorldEdge = weWrap) and ((TestCollisionXwithGear(Gear, 1) <> 0) or (TestCollisionXwithGear(Gear, -1) <> 0))  then
         // Stop hedgehog if it collides with land *just* behind other side of world wrap edge
-        begin
-        if (hwRound(tX) > LongInt(leftX) + Gear^.Radius * 2) then
-            Gear^.X:= int2HwFloat(RightX)
-        else
-            Gear^.X:= int2HwFloat(LeftX);
-        Gear^.dX.QWordValue:= 0;
-        Gear^.State := Gear^.State or gstCollision;
-        end
+        if ((Gear^.State and gstNotKickable) = 0) then
+            begin
+            if (hwRound(tX) > LongInt(leftX) + Gear^.Radius * 2) then
+                Gear^.X:= int2HwFloat(RightX)
+            else
+                Gear^.X:= int2HwFloat(LeftX);
+            Gear^.dX.QWordValue:= 0;
+            Gear^.State := Gear^.State or gstCollision;
+            end;
     end;
 
 CheckSum:= CheckSum xor Gear^.Hedgehog^.BotLevel;