From: Jan Behrens Date: Tue, 23 Apr 2013 07:40:37 +0000 (+0200) Subject: Fix bug in player badges: win% color computed wrong X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=3af3fdacefdca6abef7ed68e91ea100208c77a96;p=xonotic%2Fxonstat.git Fix bug in player badges: win% color computed wrong --- diff --git a/xonstat/batch/badges/skin.py b/xonstat/batch/badges/skin.py index 982512e..f18370f 100644 --- a/xonstat/batch/badges/skin.py +++ b/xonstat/batch/badges/skin.py @@ -413,16 +413,16 @@ class Skin: try: txt = "%.2f%%" % round(win_pct, 2) except: - win_pct = 0 + win_pct = 0. if self.winp_pos: - if win_pct >= 0.5: - nr = 2*(win_pct-0.5) + if win_pct >= 50.0: + nr = 2*(win_pct/100-0.5) r = nr*self.winp_colortop[0] + (1-nr)*self.winp_colormid[0] g = nr*self.winp_colortop[1] + (1-nr)*self.winp_colormid[1] b = nr*self.winp_colortop[2] + (1-nr)*self.winp_colormid[2] else: - nr = 2*win_pct + nr = 2*(win_pct/100) r = nr*self.winp_colormid[0] + (1-nr)*self.winp_colorbot[0] g = nr*self.winp_colormid[1] + (1-nr)*self.winp_colorbot[1] b = nr*self.winp_colormid[2] + (1-nr)*self.winp_colorbot[2]