From: Benjamin Auder Date: Thu, 12 Mar 2020 15:59:08 +0000 (+0100) Subject: Fix getCurrentScore in Racingkings variant X-Git-Url: https://git.auder.net/doc/html/css/current/scripts/pieces/DESCRIPTION?a=commitdiff_plain;h=0e76401fc85b8e621682e4e40b471e047ec2b630;p=vchess.git Fix getCurrentScore in Racingkings variant --- diff --git a/client/src/variants/Racingkings.js b/client/src/variants/Racingkings.js index 21d5c85d..f1161fce 100644 --- a/client/src/variants/Racingkings.js +++ b/client/src/variants/Racingkings.js @@ -44,7 +44,8 @@ export const VariantRules = class RacingkingsRules extends ChessRules { // at next move, then it should be a draw: if (color == "w" && this.kingPos['b'][0] == 1) { // Search for a move - const oppKingMoves = this.getPotentialKingMoves(this.kingPos['b']); + const oppKingMoves = this.filterValid( + this.getPotentialKingMoves(this.kingPos['b'])); if (oppKingMoves.some(m => m.end.x == 0)) return "*"; } return color == "w" ? "1-0" : "0-1";