Merge b988d3be7100
authorWuzzy <Wuzzy2@mail.ru>
Sat, 06 Jun 2020 15:43:17 +0200
changeset 15621 d275bb6b85b4
parent 15620 6e72bd61002e (current diff)
parent 15617 b988d3be7100 (diff)
child 15622 dc62f1c13bb2
Merge b988d3be7100
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Sat Jun 06 15:40:51 2020 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Sat Jun 06 15:43:17 2020 +0200
@@ -1849,7 +1849,7 @@
 procedure doStepBlowTorchWork(Gear: PGear);
 var
     HHGear: PGear;
-    b: boolean;
+    dig: boolean;
     prevX: LongInt;
 begin
     AllInactive := false;
@@ -1868,14 +1868,14 @@
 
     HedgehogChAngle(HHGear);
 
-    b := false;
+    dig := false;
 
     if abs(LongInt(HHGear^.Angle) - BTPrevAngle) > 7  then
         begin
         Gear^.dX := SignAs(AngleSin(HHGear^.Angle) * _0_5, Gear^.dX);
         Gear^.dY := AngleCos(HHGear^.Angle) * ( - _0_5);
         BTPrevAngle := HHGear^.Angle;
-        b := true
+        dig := true
         end;
 
     if ((HHGear^.State and gstMoving) <> 0) then
@@ -1887,7 +1887,7 @@
 
     if Gear^.Timer mod cHHStepTicks = 0 then
         begin
-        b := true;
+        dig := true;
         if Gear^.dX.isNegative then
             HHGear^.Message := (HHGear^.Message and (gmAttack or gmUp or gmDown)) or gmLeft
         else
@@ -1898,14 +1898,13 @@
             HHGear^.State := HHGear^.State and (not gstAttacking);
             prevX := hwRound(HHGear^.X);
 
-            // why the call to HedgehogStep then a further increment of X?
-            if (prevX = hwRound(HHGear^.X)) and
-               CheckLandValue(hwRound(HHGear^.X + SignAs(_6, HHGear^.dX)), hwRound(HHGear^.Y),
-               lfIndestructible) then HedgehogStep(HHGear);
-
-            if (prevX = hwRound(HHGear^.X)) and
-               CheckLandValue(hwRound(HHGear^.X + SignAs(_6, HHGear^.dX)), hwRound(HHGear^.Y),
-               lfIndestructible) then HHGear^.X := HHGear^.X + SignAs(_1, HHGear^.dX);
+            if CheckLandValue(hwRound(HHGear^.X + SignAs(_6, HHGear^.dX)), hwRound(HHGear^.Y),lfIndestructible) then
+                begin
+                HedgehogStep(HHGear);
+                if (prevX = hwRound(HHGear^.X)) then
+                    HHGear^.X := HHGear^.X + SignAs(_1, HHGear^.dX);
+                end;
+
             HHGear^.State := HHGear^.State or gstAttacking
             end;
 
@@ -1924,7 +1923,7 @@
             end;
         end;
 
-    if b then
+    if dig then
         begin
         DrawTunnel(HHGear^.X + Gear^.dX * cHHRadius,
         HHGear^.Y + Gear^.dY * cHHRadius - _1 -