From 9631507271c3385e8941fc81f436e80811d789c1 Mon Sep 17 00:00:00 2001 From: Alec Maier Date: Sun, 12 Apr 2020 14:00:24 -0400 Subject: [PATCH] Clear clock on game end --- server.js | 2 +- static/game.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 563cb62..72f1ca1 100644 --- a/server.js +++ b/server.js @@ -80,7 +80,7 @@ function teamWon(game) { if (wolvesAlive === 0) { return "village" } - if ((wolvesAlive === villagersAlive) && (totalAlive !== 2)) { + if ((wolvesAlive >= villagersAlive) && (totalAlive !== 2)) { return "wolf"; } if (totalAlive === 2) { diff --git a/static/game.js b/static/game.js index 1cf21ef..ceec169 100644 --- a/static/game.js +++ b/static/game.js @@ -115,6 +115,7 @@ function getLiveCount() { } function renderEndSplash() { + clearInterval(clock); document.getElementById("game-container").remove(); document.querySelector("#message-box").style.display = 'none'; currentGame.winningTeam === "village" @@ -209,7 +210,6 @@ function renderDeadAndAliveInformation() { return a.card.role > b.card.role ? 1 : -1; }); let deadPlayers = currentGame.players.filter((player) => player.dead); - console.log(deadPlayers); deadPlayers.sort((a, b) => { // sort players by the time they died return new Date(a.deadAt) > new Date(b.deadAt) ? -1 : 1; });