uStats: Fix DamageGiven being counted twice, fix self-damage msg never appearing
authorWuzzy <Wuzzy2@mail.ru>
Sat, 27 Oct 2018 15:13:49 +0200
changeset 14017 7b66a2e9b368
parent 14016 3c40754f6cfe
child 14018 caf7a86214bd
uStats: Fix DamageGiven being counted twice, fix self-damage msg never appearing
hedgewars/uStats.pas
--- a/hedgewars/uStats.pas	Sat Oct 27 13:27:45 2018 +0200
+++ b/hedgewars/uStats.pas	Sat Oct 27 15:13:49 2018 +0200
@@ -100,7 +100,6 @@
 //////////////////////////
 
 inc(Attacker^.stats.StepDamageGiven, Damage);
-inc(Attacker^.stats.DamageGiven, Damage);
 inc(Gear^.Hedgehog^.stats.StepDamageRecv, Damage);
 
 if CurrentHedgehog^.Team^.Clan = Gear^.Hedgehog^.Team^.Clan then inc(DamageClan, Damage);
@@ -221,7 +220,7 @@
         begin
         AddVoice(sndStupid, PreviousTeam^.voicepack);
         // Message for hurting itself only (not drowning)
-        if (CurrentHedgehog^.stats.DamageGiven = CurrentHedgehog^.stats.StepDamageRecv) and (CurrentHedgehog^.stats.StepDamageRecv >= 1) then
+        if (CurrentHedgehog^.stats.StepDamageGiven = CurrentHedgehog^.stats.StepDamageRecv) and (CurrentHedgehog^.stats.StepDamageRecv >= 1) then
             AddCaption(FormatA(GetEventString(eidHurtSelf), s), capcolDefault, capgrpMessage);
         end