]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Ensure floats. elo-ping-latency
authorAnt Zucaro <azucaro@gmail.com>
Mon, 24 Apr 2017 23:43:48 +0000 (19:43 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Mon, 24 Apr 2017 23:43:48 +0000 (19:43 -0400)
xonstat/elo.py

index 536f16e4bf1c5de15eee0d93416c50a002a2ab1b..0e00407e12a6736057ce7c249b6dbbcddb165809 100644 (file)
@@ -221,7 +221,7 @@ class EloProcessor:
                 # adjust the elo prediction according to ping
                 ping_ratio = self.pingfactor(pi, pj)
                 scorefactor_ping = ep.latency_trend_factor * (0.5 - ping_ratio)
-                scorefactor_elo_adjusted = max(0, min(1, scorefactor_elo + scorefactor_ping))
+                scorefactor_elo_adjusted = max(0.0, min(1.0, scorefactor_elo + scorefactor_ping))
 
                 # initial adjustment values, which we may modify with additional rules
                 adjustmenti = scorefactor_real - scorefactor_elo_adjusted