]> git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Don't compute the frag matrix for all game types.
authorAnt Zucaro <azucaro@gmail.com>
Sat, 18 Nov 2017 14:17:30 +0000 (09:17 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Sat, 18 Nov 2017 14:17:30 +0000 (09:17 -0500)
xonstat/views/submission.py

index 8b42dbc53ad031c9fb762674275a040fb6311ab4..085ed2b1f8d04cfc3a7bc3fbc171259e54631782 100644 (file)
@@ -405,6 +405,13 @@ def should_do_weapon_stats(game_type_cd):
     return game_type_cd not in {'cts'}
 
 
+def should_do_frag_matrix(game_type_cd):
+    """True if the game type should record frag matrix values. False otherwise."""
+    return game_type_cd in {
+        'as', 'ca', 'ctf', 'dm', 'dom', 'ft', 'freezetag', 'ka', 'kh', 'rune', 'tdm',
+    }
+
+
 def gametype_elo_eligible(game_type_cd):
     """True of the game type should process Elos. False otherwise."""
     return game_type_cd in {'duel', 'dm', 'ca', 'ctf', 'tdm', 'ka', 'ft'}
@@ -1145,7 +1152,8 @@ def submit_stats(request):
             pgstat = create_game_stat(session, game, gmap, player, events)
             pgstats.append(pgstat)
 
-            frag_matrix = create_frag_matrix(session, submission.player_indexes, pgstat, events)
+            if should_do_frag_matrix(submission.game_type_cd):
+                create_frag_matrix(session, submission.player_indexes, pgstat, events)
 
             # player ranking opt-out
             if 'r' in events and events['r'] == '0':