hedgewars/uGearsHandlersMess.pas
changeset 14209 4b418709b1cf
parent 14207 dcf235a1f86b
child 14287 6015b74eea55
--- a/hedgewars/uGearsHandlersMess.pas	Tue Nov 13 07:45:27 2018 +0300
+++ b/hedgewars/uGearsHandlersMess.pas	Tue Nov 13 08:11:31 2018 +0300
@@ -2094,8 +2094,6 @@
     //Disable targeting while the airmine is stunned
     if Gear^.Tag <> 0 then
         begin
-        Gear^.Hedgehog:= nil;
-
         if ((Gear^.FlightTime and $FF) = 0) then
             begin
             sparkle:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1);
@@ -2110,7 +2108,12 @@
 
         dec(Gear^.FlightTime);
         if Gear^.FlightTime = 0 then
+            begin
             Gear^.Tag:= 0;
+            Gear^.Hedgehog:= nil;
+            Gear^.State:= Gear^.State and (not gstAttacking);
+            Gear^.Timer:= Gear^.WDTimer
+            end;
         exit
         end;