X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FCapture.js;h=19ce734e09d5330bd65d3e8cf990253015756226;hb=801e28709e778bd3a93b014d1f9cb2fb7906e303;hp=f0782a69bc346122f907af467a7d660d2c89e931;hpb=32f6285ee325a14286562a53baefc647201df2af;p=vchess.git diff --git a/client/src/variants/Capture.js b/client/src/variants/Capture.js index f0782a69..19ce734e 100644 --- a/client/src/variants/Capture.js +++ b/client/src/variants/Capture.js @@ -6,7 +6,7 @@ export class CaptureRules extends ChessRules { return moves.filter(m => m.vanish.length == 2 && m.appear.length == 1); } - // Stop at the first capture found (if any) + // Stop at the first capture found (if any) atLeastOneCapture() { const color = this.turn; const oppCol = V.GetOppCol(color); @@ -36,11 +36,8 @@ export class CaptureRules extends ChessRules { getAllValidMoves() { const moves = super.getAllValidMoves(); - if (moves.some(m => m.vanish.length == 2)) return V.KeepCaptures(moves); + if (moves.some(m => m.vanish.length == 2 && m.appear.length == 1)) + return V.KeepCaptures(moves); return moves; } - - static get SEARCH_DEPTH() { - return 4; - } };