When someone resigns, the game doesn't technically end
Closed this issue · 2 comments
xl4624 commented
When a player resigns from the game, they can still go back to the same link and continue playing. Should we have some sort of field for Game
that's like if the game is active or not? And if it isn't then don't allow any moves? What do you guys think? @kcao20 @austinngan
I'm thinking about modifying this, since I'm assuming chess.js handles draws, checkmates, stalemates, etc... in isGameOver()
so we just need to add one more condition
function onDragStart(source, piece, position, orientation) {
if (game.isGameOver() === true ||
(game.turn() === 'w' && piece.search(/^b/) !== -1) ||
(game.turn() === 'b' && piece.search(/^w/) !== -1)) {
return false;
}
}