X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FBishopawns.js;h=67afe66ca66d1ab198df4da206ebb1420dfdab42;hp=1ee9b97a4072b0e632159546a74363b955bef0c3;hb=9f88188c42120d985c6c280d2712a3b7f6f7c86c;hpb=8e346ebebfdaec1538f9728fa7a279027c990f78 diff --git a/client/src/variants/Bishopawns.js b/client/src/variants/Bishopawns.js index 1ee9b97a..67afe66c 100644 --- a/client/src/variants/Bishopawns.js +++ b/client/src/variants/Bishopawns.js @@ -36,8 +36,12 @@ export class BishopawnsRules extends ChessRules { } // Did a black pawn promote? Can the bishop take it? const qIdx = this.board[7].findIndex(cell => cell[1] == V.QUEEN); - if (qIdx >= 0 && !super.isAttackedByBishop([7, qIdx], 'w')) + if ( + qIdx >= 0 && + (this.turn == 'b' || !super.isAttackedByBishop([7, qIdx], 'w')) + ) { return "0-1"; + } if (!this.atLeastOneMove()) return "1/2"; return "*"; }