]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
fix missing gametypes in some player badges zykure/wip
authorJan Behrens <zykure@web.de>
Sun, 6 Apr 2014 13:42:38 +0000 (15:42 +0200)
committerJan Behrens <zykure@web.de>
Sun, 6 Apr 2014 13:42:38 +0000 (15:42 +0200)
xonstat/batch/badges/skin.py

index 2ea0a99557f920949c423b6db0747cbf64f6ef36..edcb2eb4acde76cff706f71b9008abac03d05e73 100644 (file)
@@ -204,22 +204,18 @@ class Skin:
 
         # make sorted list of gametypes
         game_types = []
-        num_games  = 0
-        for gt,info in data['games_played'].items():
-            if gt == "overall":
+        for gt in data['games_played'].keys():
+            if gt == 'overall':
                 continue
-            if info.games > num_games:
-                game_types.insert(0, gt)
-            else:
-                game_types.append(gt)
+            if elos.has_key(gt):
+                game_types.append(gt)  # only uses gametypes with elo values (needed later on)
 
-        # make sure gametypes list if sorted correctly (number of games, descending)
-        #game_types = sorted(game_types, key=lambda x: data['games_played'][x].games, reverse=True)
+        ## make sure gametypes list if sorted correctly (number of games, descending)
+        ##game_types = sorted(game_types, key=lambda x: data['games_played'][x].games, reverse=True)
         # make sure gametypes list if sorted correctly (total playing time per game type, descending)
         game_types = sorted(game_types, key=lambda x: data['overall_stats'][x].total_playing_time, reverse=True)
 
 
-
         # build image
 
         surf = C.ImageSurface(C.FORMAT_ARGB32, self.width, self.height)