From 6b8cf922d180b855dc3a86385a7656a7a35c5621 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 23 Jan 2021 15:40:45 -0500 Subject: [PATCH] Fix --- commands/games-mp/chess.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/games-mp/chess.js b/commands/games-mp/chess.js index 3c4d0da9..4e5e0a19 100644 --- a/commands/games-mp/chess.js +++ b/commands/games-mp/chess.js @@ -93,8 +93,8 @@ module.exports = class ChessCommand extends Command { } else { await msg.say('Sorry, time is up! Playing random move.'); const moves = game.moves(); - const pieces = Object.keys(moves); - const piece = pieces[Math.floor(Math.random() * pieces.length)]; + const available = Object.keys(moves); + const piece = available[Math.floor(Math.random() * available.length)]; const move = moves[piece][Math.floor(Math.random() * moves[piece].length)]; game.move(piece, move); lastTurnTimeout = true;