From c4a955d55643472322cd42bfbd199b97ebba4ff0 Mon Sep 17 00:00:00 2001 From: gohlkeMax Date: Thu, 1 Jul 2021 19:23:03 +0200 Subject: [PATCH] Remove undefined Playernames from Scoreboard --- public/js/game.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/js/game.js b/public/js/game.js index 274a3cd..466a8fe 100644 --- a/public/js/game.js +++ b/public/js/game.js @@ -178,10 +178,10 @@ function start_game() { score_button.defaultCursor = 'pointer'; score_button.on('pointerdown', function () { card = new Card(game_board_size, "", - { "text": playerNames[0] + ": " + positions[0], "status": false }, - { "text": playerNames[1] + ": " + positions[1], "status": false }, - { "text": playerNames[2] + ": " + positions[2], "status": false }, - { "text": playerNames[3] + ": " + positions[3], "status": false }, 0, false); + { "text": playerNames[0]? playerNames[0] + ": " + positions[0] : ("Kein Spieler"), "status": false }, + { "text": playerNames[1]? playerNames[1] + ": " + positions[1] : ("Kein Spieler"), "status": false }, + { "text": playerNames[2]? playerNames[2] + ": " + positions[2] : ("Kein Spieler"), "status": false }, + { "text": playerNames[3]? playerNames[3] + ": " + positions[3] : ("Kein Spieler"), "status": false }, 0, false); card.showCard(); show_card = true; });