# HG changeset patch # User Wuzzy # Date 1544428545 -3600 # Node ID 9561bf634b21190d2c907e1a34a4a2a794a5ffd2 # Parent 8af01d65ccda744f93d500d707dfa33e0ab16d60 Fix "first blood" taunt being repeated if same hog got hurt again diff -r 8af01d65ccda -r 9561bf634b21 hedgewars/uStats.pas --- 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;