X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FCrazyhouse.js;h=7fa47b7253fd406d8cf3175c0a21dfab609304a4;hp=64ce48b3a606933a5f4b3e92c3f8d53f40891a02;hb=d982fffc441a0443be90ba6f57a94d1d60b702c8;hpb=259035ec507062fdfc7158ac62b68c722404bfdf diff --git a/client/src/variants/Crazyhouse.js b/client/src/variants/Crazyhouse.js index 64ce48b3..7fa47b72 100644 --- a/client/src/variants/Crazyhouse.js +++ b/client/src/variants/Crazyhouse.js @@ -185,17 +185,15 @@ export class CrazyhouseRules extends ChessRules { } atLeastOneMove() { - if (!super.atLeastOneMove()) { - // Search one reserve move - for (let i = 0; i < V.RESERVE_PIECES.length; i++) { - const moves = this.filterValid( - this.getReserveMoves([V.size.x + (this.turn == "w" ? 0 : 1), i]) - ); - if (moves.length > 0) return true; - } - return false; + if (super.atLeastOneMove()) return true; + // Search one reserve move + for (let i = 0; i < V.RESERVE_PIECES.length; i++) { + const moves = this.filterValid( + this.getReserveMoves([V.size.x + (this.turn == "w" ? 0 : 1), i]) + ); + if (moves.length > 0) return true; } - return true; + return false; } postPlay(move) {