]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Proper fix for big alivetimes.
authorAnt Zucaro <azucaro@gmail.com>
Tue, 13 Nov 2012 00:59:37 +0000 (19:59 -0500)
committerJan Behrens <zykure@web.de>
Sun, 23 Dec 2012 14:18:34 +0000 (15:18 +0100)
Moral of the story: I should not code late at night.

xonstat/elo.py

index 74c49cd589137f6e4e15c974bff65238512368a2..8293c97f8fa705ebb29c5d81c61ca61d40da8c93 100644 (file)
@@ -66,13 +66,12 @@ def process_elos(game, session, game_type_cd=None):
                 # with a short circuit to handle alivetimes > game
                 # durations, which can happen due to warmup being
                 # included (most often in duels)
-                if game.duration is not None:
-                    if a.seconds > game.duration.seconds:
-                        scores[p] = s/float(game.duration.seconds)
+                if game.duration is not None and a.seconds > game.duration.seconds:
+                    scores[p] = s/float(game.duration.seconds)
+                    alivetimes[p] = game.duration.seconds
                 else:
                     scores[p] = s/float(a.seconds)
-
-                alivetimes[p] = a.seconds
+                    alivetimes[p] = a.seconds
 
     player_ids = scores.keys()