hedgewars/uGearsUtils.pas
changeset 15200 7d41e7889123
parent 15186 d13a38548112
child 15225 ceb289e8a582
--- a/hedgewars/uGearsUtils.pas	Sun Jun 23 11:28:00 2019 +0200
+++ b/hedgewars/uGearsUtils.pas	Sun Jun 23 16:14:27 2019 +0200
@@ -283,8 +283,16 @@
         Gear^.LastDamage := AttackerHog;
 
         Gear^.Hedgehog^.Team^.Clan^.Flawless:= false;
-        HHHurt(Gear^.Hedgehog, Source, Damage);
-        AddDamageTag(hwRound(Gear^.X), hwRound(Gear^.Y), Damage, Gear^.Hedgehog^.Team^.Clan^.Color);
+
+        if (Gear^.State and gstHHDeath) <> 0 then
+            // If hog took damage while dying, explode hog instantly (see doStepHedgehogDead)
+            Gear^.Timer:= 1
+        else
+            begin
+            HHHurt(Gear^.Hedgehog, Source, Damage);
+            AddDamageTag(hwRound(Gear^.X), hwRound(Gear^.Y), Damage, Gear^.Hedgehog^.Team^.Clan^.Color);
+            end;
+
         tmpDmg:= min(Damage, max(0,Gear^.Health-Gear^.Damage));
         if (Gear <> CurrentHedgehog^.Gear) and (CurrentHedgehog^.Gear <> nil) and (tmpDmg >= 1) then
             begin