]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Workaround for missing fastest for RC/CTS
authorAnt Zucaro <azucaro@gmail.com>
Sat, 2 Feb 2013 15:41:11 +0000 (10:41 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Sat, 2 Feb 2013 15:41:11 +0000 (10:41 -0500)
xonstat/templates/scoreboard.mako

index e2433056284ce0e8d113d50d3d9e3f938f84cf5c..f9d412d5cc805e9239de9a49488f86a622060767 100644 (file)
@@ -264,7 +264,11 @@ ${scoreboard_header(game_type_cd, pgstats[0])}
 % endif
 
 % if game_type_cd == 'cts':
+        % if pgstat.fastest is not None:
         <td>${round(float(pgstat.fastest.seconds) + (pgstat.fastest.microseconds/1000000.0), 2)}</td>
+        % else:
+        <td>-</td>
+        % endif
         <td>${pgstat.deaths}</td>
 % endif
 
@@ -293,7 +297,13 @@ ${scoreboard_header(game_type_cd, pgstats[0])}
         <td>${pgstat.kills}</td>
         <td>${pgstat.deaths}</td>
         <td>${pgstat.pickups}</td>
-        <td>${pgstat.time}</td>
+
+        % if pgstat.time is not None:
+        <td>${round(float(pgstat.time.seconds) + (pgstat.time.microseconds/1000000.0), 2)}</td>
+        % else:
+        <td>-</td>
+        % endif
+
         <td>${pgstat.fckills}</td>
 % endif
 
@@ -315,8 +325,18 @@ ${scoreboard_header(game_type_cd, pgstats[0])}
 
 % if game_type_cd == 'rc':
         <td>${pgstat.laps}</td>
+
+        % if pgstat.fastest is not None:
         <td>${round(float(pgstat.fastest.seconds) + (pgstat.fastest.microseconds/1000000.0), 2)}</td>
+        % else:
+        <td>-</td>
+        % endif
+
+        % if pgstat.time is not None:
         <td>${round(float(pgstat.time.seconds) + (pgstat.time.microseconds/1000000.0), 2)}</td>
+        % else:
+        <td>-</td>
+        % endif
 % endif
 
 </%def>