From 82902f96f86103f4c45ac826ea32c3377e0429e9 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Tue, 19 Jan 2021 18:29:15 -0500 Subject: [PATCH] Lowest block will always topple --- commands/games-mp/jenga.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/games-mp/jenga.js b/commands/games-mp/jenga.js index ff5ccf03..a4853234 100644 --- a/commands/games-mp/jenga.js +++ b/commands/games-mp/jenga.js @@ -87,7 +87,7 @@ module.exports = class JengaCommand extends Command { } i = picked - 1; } - const fell = Math.floor(Math.random() * ((board.length + 1) - i)); + const fell = Math.floor(Math.random() * ((board.length + 1) - (i + 1)); if (!fell) { winner = userTurn ? opponent : msg.author; await msg.say(`${opponent.bot && !userTurn ? `I pick ${i + 1}, a` : 'A'}nd the tower topples!`);