From b37983d4278ebb20d9dff22f195212752dd47254 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Tue, 19 Jan 2021 19:02:20 -0500 Subject: [PATCH] Fix --- commands/games-mp/jenga.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/commands/games-mp/jenga.js b/commands/games-mp/jenga.js index 9e030dfd..199fb9f1 100644 --- a/commands/games-mp/jenga.js +++ b/commands/games-mp/jenga.js @@ -87,6 +87,13 @@ module.exports = class JengaCommand extends Command { } i = picked - 1; } + if (board.length === 1) { + winner = userTurn ? msg.author : opponent; + const text = opponent.bot && !userTurn + ? 'I pick up the last piece and win!' + : `${winner} picks up the last piece, winning the game!`; + await msg.say(text); + } const fell = Math.floor(Math.random() * ((board.length + 1) - (i + 1))); if (!fell) { winner = userTurn ? opponent : msg.author;