Call hog stupid for selfkilling
authorWuzzy <almikes@aol.com>
Wed, 19 Apr 2017 22:26:24 +0200
changeset 12291 e2b30aba00e1
parent 12290 4ce7cb441c75
child 12292 93434ab299a0
Call hog stupid for selfkilling
hedgewars/uStats.pas
--- a/hedgewars/uStats.pas	Wed Apr 19 22:10:12 2017 +0200
+++ b/hedgewars/uStats.pas	Wed Apr 19 22:26:24 2017 +0200
@@ -133,11 +133,12 @@
     if ((DamageTotal > 0) or (KillsTotal > 0) or (PoisonTotal > 0)) and ((CurrentHedgehog^.stats.DamageGiven = DamageTotal) and (CurrentHedgehog^.stats.StepKills = KillsTotal) and (PoisonTotal = PoisonTurn + PoisonClan)) then
         AddVoice(sndFirstBlood, CurrentTeam^.voicepack)
 
-    // Hog hurts or poisons itself
-    else if (CurrentHedgehog^.stats.StepDamageRecv > 0) or (CurrentHedgehog^.stats.StepPoisoned) then
+    // Hog hurts, poisons or kills itself
+    else if (CurrentHedgehog^.stats.StepDamageRecv > 0) or (CurrentHedgehog^.stats.StepPoisoned) or (CurrentHedgehog^.Gear = nil) then
         begin
         AddVoice(sndStupid, PreviousTeam^.voicepack);
-        if CurrentHedgehog^.stats.DamageGiven = CurrentHedgehog^.stats.StepDamageRecv then
+        // Message for hurting itself only (not drowning)
+        if (CurrentHedgehog^.stats.DamageGiven = CurrentHedgehog^.stats.StepDamageRecv) and (CurrentHedgehog^.stats.StepDamageRecv >= 1) then
             AddCaption(FormatA(GetEventString(eidHurtSelf), s), cWhiteColor, capgrpMessage);
         end