From 0e76401fc85b8e621682e4e40b471e047ec2b630 Mon Sep 17 00:00:00 2001
From: Benjamin Auder <benjamin.auder@somewhere>
Date: Thu, 12 Mar 2020 16:59:08 +0100
Subject: [PATCH] Fix getCurrentScore in Racingkings variant

---
 client/src/variants/Racingkings.js | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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";
-- 
2.44.0