From 3eb90e938f728838ec038f76edf8a5eef303c466 Mon Sep 17 00:00:00 2001 From: Astro Date: Tue, 21 Sep 2010 02:15:20 +0200 Subject: [PATCH] look, a bug! --- quiz.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/quiz.js b/quiz.js index 9b5c99c..4b48294 100644 --- a/quiz.js +++ b/quiz.js @@ -85,11 +85,11 @@ function switchToScoreboard() { function updateScores() { for(var i = 0; i < playerNames.length; i++) { - if (!playerNames[i]) - continue; - - $('#scoreboard dl dd').eq(i).text(playerScores[i]); - $('#players .player'+i+' .score').text(playerScores[i]); + if (playerNames[i]) { + // FIXME: eq(i) is bad when first player is empty + $('#scoreboard dl dd').eq(i).text(playerScores[i]); + $('#players .player'+i+' .score').text(playerScores[i]); + } } }