Fix hedgehog self-damage not counted, and there were never Stupid taunts/announces
authorWuzzy <almikes@aol.com>
Wed, 19 Apr 2017 22:03:11 +0200
changeset 12294 c20fbf96b853
parent 12293 a5a7d0c6d3f3
child 12295 4ce7cb441c75
Fix hedgehog self-damage not counted, and there were never Stupid taunts/announces
hedgewars/uGearsUtils.pas
--- a/hedgewars/uGearsUtils.pas	Wed Apr 19 20:50:57 2017 +0200
+++ b/hedgewars/uGearsUtils.pas	Wed Apr 19 22:03:11 2017 +0200
@@ -304,15 +304,16 @@
                         end;
                     end
                 end;
-        if (GameFlags and gfKarma <> 0) and (GameFlags and gfInvulnerable = 0) and
-           (CurrentHedgehog^.Effects[heInvulnerable] = 0) then
-            begin // this cannot just use Damage or it interrupts shotgun and gets you called stupid
-            inc(CurrentHedgehog^.Gear^.Karma, tmpDmg);
-            CurrentHedgehog^.Gear^.LastDamage := CurrentHedgehog;
-            spawnHealthTagForHH(CurrentHedgehog^.Gear, tmpDmg);
+            if (GameFlags and gfKarma <> 0) and (GameFlags and gfInvulnerable = 0) and
+               (CurrentHedgehog^.Effects[heInvulnerable] = 0) then
+                begin // this cannot just use Damage or it interrupts shotgun and gets you called stupid
+                inc(CurrentHedgehog^.Gear^.Karma, tmpDmg);
+                CurrentHedgehog^.Gear^.LastDamage := CurrentHedgehog;
+                spawnHealthTagForHH(CurrentHedgehog^.Gear, tmpDmg);
+                end;
             end;
+
         uStats.HedgehogDamaged(Gear, AttackerHog, Damage, false);
-        end;
 
 	if AprilOne and (Gear^.Hedgehog^.Hat = 'fr_tomato') and (Damage > 2) then
 	    for i := 0 to random(min(Damage,20))+5 do