From ff78e93dda66a054b376a0e8111b6fe0016c8096 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 29 Jan 2021 16:59:17 -0500 Subject: [PATCH] Do not allow save game time reset --- commands/games-mp/chess.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commands/games-mp/chess.js b/commands/games-mp/chess.js index a83383fb..db20ef9a 100644 --- a/commands/games-mp/chess.js +++ b/commands/games-mp/chess.js @@ -153,6 +153,8 @@ module.exports = class ChessCommand extends Command { const verification = await verify(msg.channel, author); if (!verification) continue; // eslint-disable-line max-depth } + if (gameState.turn === 'black') blackTime -= new Date() - now; + if (gameState.turn === 'white') whiteTime -= new Date() - now; await this.client.redis.set( `chess-${author.id}`, this.exportGame(game, blackTime, whiteTime, whitePlayer.id === author.id ? 'white' : 'black')