X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FBenedict.js;h=039aaeaf93b2f7b72a51876be811e7e4ca5103f7;hp=4ca5292d1d06ca2de174877f8e6b71afb5a0b34f;hb=a930dd712643df1d673bdc2b777b5912b9a41584;hpb=35ff9d1b79c050a7b8304bd725221aaee57f7209 diff --git a/client/src/variants/Benedict.js b/client/src/variants/Benedict.js index 4ca5292d..039aaeaf 100644 --- a/client/src/variants/Benedict.js +++ b/client/src/variants/Benedict.js @@ -135,13 +135,10 @@ export class BenedictRules extends ChessRules { // Stop at the first move found atLeastOneMove() { const color = this.turn; - const oppCol = V.GetOppCol(color); for (let i = 0; i < V.size.x; i++) { for (let j = 0; j < V.size.y; j++) { - if (this.board[i][j] != V.EMPTY && this.getColor(i, j) != oppCol) { - const moves = this.getPotentialMovesFrom([i, j]); - if (moves.length > 0) - return true; + if (this.board[i][j] != V.EMPTY && this.getColor(i, j) == color) { + if (this.getPotentialMovesFrom([i, j]).length > 0) return true; } } }