Make hog kill stat stuff consistent WRT SD water rise
authorWuzzy <Wuzzy2@mail.ru>
Tue, 15 Jan 2019 21:28:54 +0100
changeset 14597 6d2954037e57
parent 14596 1c7439c50f4d
child 14598 62dea281e4d5
Make hog kill stat stuff consistent WRT SD water rise
hedgewars/uStats.pas
--- a/hedgewars/uStats.pas	Tue Jan 15 21:23:56 2019 +0100
+++ b/hedgewars/uStats.pas	Tue Jan 15 21:28:54 2019 +0100
@@ -107,7 +107,7 @@
 else
     begin
     vpHurtEnemy:= Gear^.Hedgehog^.Team^.voicepack;
-    if (not killed) then
+    if (not killed) and (not bDuringWaterRise) then
         begin
         // Check if victim got attacked by RevengeHog again
         if (Gear^.Hedgehog^.RevengeHog <> nil) and (Gear^.Hedgehog^.RevengeHog = Attacker) then
@@ -128,8 +128,11 @@
 
 //////////////////////////
 
-inc(Attacker^.stats.StepDamageGiven, Damage);
-inc(Gear^.Hedgehog^.stats.StepDamageRecv, Damage);
+if (not bDuringWaterRise) then
+    begin
+    inc(Attacker^.stats.StepDamageGiven, Damage);
+    inc(Gear^.Hedgehog^.stats.StepDamageRecv, Damage);
+    end;
 
 if CurrentHedgehog^.Team^.Clan = Gear^.Hedgehog^.Team^.Clan then inc(DamageClan, Damage);
 if CurrentHedgehog^.Team = Gear^.Hedgehog^.Team then inc(DamageTeam, Damage);
@@ -137,7 +140,6 @@
 if killed then
     begin
     Gear^.Hedgehog^.stats.StepDied:= true;
-    inc(Attacker^.stats.StepKills);
     inc(Kills);
 
     inc(KillsTotal);
@@ -146,6 +148,7 @@
         inc(KillsSD)
     else
         begin
+        inc(Attacker^.stats.StepKills);
         inc(Attacker^.Team^.stats.Kills);
         if (Attacker^.Team^.TeamName = Gear^.Hedgehog^.Team^.TeamName) then
             begin