]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/elo.py
Add a check for humans who have fired a weapon during parsing.
[xonotic/xonstat.git] / xonstat / elo.py
index 01a1e8a93728fdbd8ce81d70efc65ed42a611cc8..bc0c332529fa8d70b4ae4e5c03cbcbe045b09b39 100644 (file)
@@ -96,10 +96,12 @@ class EloProcessor:
 
         # used to determine if a pgstat record is elo-eligible
         def elo_eligible(pgs):
-            return pgs.player_id > 2 and pgs.alivetime > timedelta(seconds=0)
+            return pgs.player_id > 2 and pgs.alivetime > datetime.timedelta(seconds=0)
+
+        elostats = filter(elo_eligible, pgstats)
 
         # only process elos for elo-eligible players
-        for pgstat in filter(elo_eligible, pgstats):
+        for pgstat in elostats:
             self.wip[pgstat.player_id] = EloWIP(pgstat.player_id, pgstat)
 
         # determine duration from the maximum alivetime