From 7074ae2d63ff7871a030fd89217696f9d8b71165 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Mon, 12 Nov 2012 19:59:37 -0500 Subject: [PATCH] Proper fix for big alivetimes. Moral of the story: I should not code late at night. --- xonstat/elo.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/xonstat/elo.py b/xonstat/elo.py index 74c49cd..8293c97 100644 --- a/xonstat/elo.py +++ b/xonstat/elo.py @@ -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() -- 2.39.2