hedgewars/uStats.pas
changeset 14409 9561bf634b21
parent 14371 2ab312c47dc3
child 14470 ca851d0957cf
--- a/hedgewars/uStats.pas	Mon Dec 10 08:20:33 2018 +0100
+++ b/hedgewars/uStats.pas	Mon Dec 10 08:55:45 2018 +0100
@@ -67,6 +67,7 @@
     HitTargets  : LongWord = 0; // Target (gtTarget) hits per turn
     AmmoUsedCount : Longword = 0;
     AmmoDamagingUsed : boolean = false;
+    FirstBlood  : boolean = false;
     LeaveMeAlone : boolean = false;
     SkippedTurns: LongWord = 0;
     isTurnSkipped: boolean = false;
@@ -254,8 +255,11 @@
         killsCheck:= 0;
 
     // First blood (first damage, poison or kill)
-    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)
+    if (not FirstBlood) and ((DamageTotal > 0) or (KillsTotal > 0) or (PoisonTotal > 0)) and ((CurrentHedgehog^.stats.DamageGiven = DamageTotal) and (CurrentHedgehog^.stats.StepKills = KillsTotal) and (PoisonTotal = PoisonTurn + PoisonClan)) then
+        begin
+        FirstBlood:= true;
+        AddVoice(sndFirstBlood, CurrentTeam^.voicepack);
+        end
 
     // 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
@@ -598,6 +602,7 @@
     HitTargets  := 0;
     AmmoUsedCount := 0;
     AmmoDamagingUsed := false;
+    FirstBlood:= false;
     LeaveMeAlone := false;
     SkippedTurns:= 0;
     isTurnSkipped:= false;