--- 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 -