hedgewars/uGearsHandlersMess.pas
changeset 15201 a0bb57d3d272
parent 15186 d13a38548112
child 15209 f55c1c895797
--- a/hedgewars/uGearsHandlersMess.pas	Sun Jun 23 16:14:27 2019 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Mon Jun 24 11:25:15 2019 +0200
@@ -3614,9 +3614,20 @@
 end;
 
 procedure doStepKamikazeIdle(Gear: PGear);
+var HHGear: PGear;
 begin
     AllInactive := false;
     dec(Gear^.Timer);
+    HHGear := Gear^.Hedgehog^.Gear;
+    if (HHGear = nil) or (HHGear^.Damage <> 0) then
+        begin
+        if (HHGear <> nil) then
+            AfterAttack;
+        ClearHitOrder();
+        ClearProximityCache();
+        DeleteGear(Gear);
+        exit;
+        end;
     if Gear^.Timer = 0 then
         begin
         Gear^.Pos := 1;