X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=html%2Fshow-tournament.pl;h=f5ecf31955d859f450cdc65b9f73b304ab982f6b;hp=89ba78d8d5bc84882c101f1ab23f6f2f31fceb34;hb=51688d09a1427570771507ac69255071752d7385;hpb=a4ddf9a2d1481470bc42cf335aaaa810c28cab8f diff --git a/html/show-tournament.pl b/html/show-tournament.pl index 89ba78d..f5ecf31 100755 --- a/html/show-tournament.pl +++ b/html/show-tournament.pl @@ -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; }