reset airmine timer on stun recovery
authoralfadur
Tue, 13 Nov 2018 08:11:31 +0300
changeset 14204 4b418709b1cf
parent 14203 076c9fba3fa8
child 14205 a8fe9cd51154
reset airmine timer on stun recovery
hedgewars/uGearsHandlersMess.pas
--- 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;