]> git.sesse.net Git - ccbs/blobdiff - html/show-tournament.pl
Added template code for showing rank.
[ccbs] / html / show-tournament.pl
index 89ba78d8d5bc84882c101f1ab23f6f2f31fceb34..f5ecf31955d859f450cdc65b9f73b304ab982f6b 100755 (executable)
@@ -61,7 +61,7 @@ for my $score (@$scores) {
        my $pl = $p->[$#$p]->{'players'};
        if ($score->{'nick'} ne $player) {
                $player = $score->{'nick'};
-               push @$pl, { player => $score->{'player'}, nick => $player, songs => [], total => 0 };
+               push @$pl, { player => $score->{'player'}, nick => $player, songs => [], total => 0, rank => 1 };
        }
        
        push @{$pl->[$#$pl]->{'songs'}}, $score;
@@ -84,7 +84,7 @@ for my $r (0..$#rounds-1) {
 
 # If there's only one group left and it's valid for closing, we can also finish
 # the entire tournament if we'd like
-if ($closing_valid && (scalar @{$rounds[$#rounds]->{'parallels'}}) == 1) {
+if ($closing_valid && (scalar @rounds > 0 && scalar @{$rounds[$#rounds]->{'parallels'}}) == 1) {
        $finishing_valid = 1;
 }