Don't play sndDrat or sndBugger on self-kill
authorWuzzy <Wuzzy2@mail.ru>
Sat, 27 Oct 2018 20:31:31 +0200
changeset 14025 bc61809bfb1e
parent 14024 1effb8b72b11
child 14026 fe2b6f3f2559
Don't play sndDrat or sndBugger on self-kill
hedgewars/uStats.pas
--- a/hedgewars/uStats.pas	Sat Oct 27 19:50:01 2018 +0200
+++ b/hedgewars/uStats.pas	Sat Oct 27 20:31:31 2018 +0200
@@ -217,8 +217,8 @@
 
     // Hog hurts, poisons or kills itself (except sacrifice)
     else if (CurrentHedgehog^.stats.Sacrificed = false) and ((CurrentHedgehog^.stats.StepDamageRecv > 0) or (CurrentHedgehog^.stats.StepPoisoned) or (CurrentHedgehog^.stats.StepDied)) then
-        // Hurting itself only (not drowning)
-        if (CurrentHedgehog^.stats.StepDamageGiven = CurrentHedgehog^.stats.StepDamageRecv) and (CurrentHedgehog^.stats.StepDamageRecv >= 1) then
+        // Hurt itself only (without dying)
+        if (CurrentHedgehog^.stats.StepDamageGiven = CurrentHedgehog^.stats.StepDamageRecv) and (CurrentHedgehog^.stats.StepDamageRecv >= 1) and (not CurrentHedgehog^.stats.StepDied) then
             begin
             // Announcer message + random taunt
             AddCaption(FormatA(GetEventString(eidHurtSelf), s), capcolDefault, capgrpMessage);
@@ -229,7 +229,7 @@
                 2: AddVoice(sndDrat, CurrentTeam^.voicepack);
                 end;
             end
-        // Hurt itself and others
+        // Hurt itself and others, or died
         else
             AddVoice(sndStupid, PreviousTeam^.voicepack)