]> de.git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/views/submission.py
Remove more refs to sqlahelper.
[xonotic/xonstat.git] / xonstat / views / submission.py
index 085ed2b1f8d04cfc3a7bc3fbc171259e54631782..567d8a4777ba67eb3e6b3c48be0d32a8230e4b37 100644 (file)
@@ -346,6 +346,10 @@ def has_minimum_real_players(settings, submission):
     except:
         minimum_required_players = 2
 
+    # Make an exception for CTS since it can be done by individuals and there is no Elo anyway
+    if submission.game_type_cd == "cts":
+        minimum_required_players = 1
+
     return len(submission.humans) >= minimum_required_players
 
 
@@ -710,10 +714,6 @@ def create_default_game_stat(session, game_type_cd):
     if game_type_cd in 'ca' 'dm' 'duel' 'rune' 'tdm':
         pgstat.kills = pgstat.deaths = pgstat.suicides = 0
 
-    if game_type_cd == 'cq':
-        pgstat.kills = pgstat.deaths = pgstat.suicides = pgstat.captures = 0
-        pgstat.drops = 0
-
     if game_type_cd == 'ctf':
         pgstat.kills = pgstat.captures = pgstat.pickups = pgstat.drops = 0
         pgstat.returns = pgstat.carrier_frags = 0
@@ -738,16 +738,10 @@ def create_default_game_stat(session, game_type_cd):
         pgstat.captures = pgstat.drops = pgstat.pushes = pgstat.destroys = 0
         pgstat.carrier_frags = 0
 
-    if game_type_cd == 'lms':
-        pgstat.kills = pgstat.deaths = pgstat.suicides = pgstat.lives = 0
-
     if game_type_cd == 'nb':
         pgstat.kills = pgstat.deaths = pgstat.suicides = pgstat.captures = 0
         pgstat.drops = 0
 
-    if game_type_cd == 'rc':
-        pgstat.kills = pgstat.deaths = pgstat.suicides = pgstat.laps = 0
-
     return pgstat
 
 
@@ -857,7 +851,7 @@ def create_default_team_stat(session, game_type_cd):
     # all team game modes have a score, so we'll zero that out always
     teamstat.score = 0
 
-    if game_type_cd in 'ca' 'ft' 'lms' 'ka':
+    if game_type_cd in 'ca' 'ft' 'ka':
         teamstat.rounds = 0
 
     if game_type_cd == 'ctf':