From 993ff0b2b4658ba6683b9055aa0d59ffda72d3f1 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 23 Jan 2021 19:40:06 -0500 Subject: [PATCH] Either player can forfeit --- commands/games-mp/chess.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/games-mp/chess.js b/commands/games-mp/chess.js index b5c61594..dd3697c4 100644 --- a/commands/games-mp/chess.js +++ b/commands/games-mp/chess.js @@ -84,9 +84,10 @@ module.exports = class ChessCommand extends Command { prevPieces = Object.assign({}, game.exportJson().pieces); const moves = game.moves(); const pickFilter = res => { - if (res.author.id !== user.id) return false; + if (![msg.author.id, opponent.id].includes(res.author.id)) return false; const choice = res.content.toUpperCase(); if (choice === 'END') return true; + if (res.author.id !== user.id) return false; const move = choice.match(turnRegex); if (!move) return false; if (!moves[move[1]] || !moves[move[1]].includes(move[2])) {