Saucer: Restore dX after "freeze" state
authorWuzzy <Wuzzy2@mail.ru>
Mon, 05 Aug 2019 22:57:12 +0200
changeset 15318 6afce21e60c3
parent 15317 b5171e6c94a4
child 15319 976b3ed9b1fd
Saucer: Restore dX after "freeze" state
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/uGearsHandlersMess.pas	Mon Aug 05 22:28:59 2019 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Mon Aug 05 22:57:12 2019 +0200
@@ -4619,8 +4619,12 @@
         end;
 
     if (HHGear^.Message and (gmAttack or gmUp or gmLeft or gmRight) <> 0) and
-       (HHGear^.Message and gmPrecise = 0) then
+       (HHGear^.Message and gmPrecise = 0) and
+       ((Gear^.State and gsttmpFlag) <> 0) then
+        begin
         Gear^.State := Gear^.State and (not gsttmpFlag);
+        HHGear^.dX := Gear^.dX;
+        end;
 
     if HHGear^.Message and gmPrecise = 0 then
         HHGear^.Message := HHGear^.Message and (not (gmUp or gmLeft or gmRight));
@@ -4682,7 +4686,8 @@
         if (dY < _0_1) and (dY > -_0_1) then
             begin
             Gear^.State := Gear^.State or gsttmpFlag;
-            dY := dY - _0_2
+            dY := dY - _0_2;
+            Gear^.dX:= dX;
             end
         end
 end;