Add game over check to chessboard script
An additional check has been added to the chessboard.js script in the ChessServer application. This check ensures that if the game is over, no further moves are allowed to be made, improving the game flow and overall user experience.
This commit is contained in:
@@ -68,6 +68,8 @@ const initGameBoard = function (color, player, gameId) {
|
||||
if (game.turn() !== color) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (game.isGameOver()) return;
|
||||
|
||||
var moves = game.moves({
|
||||
square: square,
|
||||
|
||||
Reference in New Issue
Block a user