hedgewars/uStats.pas
changeset 13758 b1177e9c9ee9
parent 13757 f0cb47f0bfaf
child 13761 6fd56a26e8b8
--- a/hedgewars/uStats.pas	Tue Sep 04 15:03:35 2018 +0200
+++ b/hedgewars/uStats.pas	Tue Sep 04 16:12:53 2018 +0200
@@ -164,15 +164,15 @@
                 StepDied:= false;
                 end;
 
-// Remember which clans died in this turn
+// Write into the death log which clans died in this turn,
+// important for final rankings.
 c:= 0;
 newEntry:= nil;
 for t:= 0 to Pred(ClansCount) do
     with ClansArray[t]^ do
         begin
-        if (ClanHealth = 0) and (ClansArray[t]^.DiedThisTurn = false) then
+        if (ClanHealth = 0) and (ClansArray[t]^.DeathLogged = false) then
             begin
-            ClansArray[t]^.DiedThisTurn:= true;
             if c = 0 then
                 begin
                 new(newEntry);
@@ -183,6 +183,7 @@
             newEntry^.KilledClans[c]:= ClansArray[t];
             inc(c);
             newEntry^.KilledClansCount := c;
+            ClansArray[t]^.DeathLogged:= true;
             end;
 
         if SendHealthStatsOn then
@@ -386,7 +387,12 @@
     The losing clans are ranked in the reverse order they died.
     The clan that died last is ranked 2nd,
     the clan that died second to last is ranked 3rd,
-    and so on. }
+    and so on.
+    Clans that died in the same turn share their rank.
+    If a clan died multiple times in the match
+    (e.g. due to resurrection), only the *latest* death of
+    that clan counts (handled in gtResurrector).
+    }
     deathEntry := ClanDeathLog;
     i:= 0;
     if SendRankingStatsOn then