X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fbase_rules.js;h=172f68b49f98528f24afe57292037e63d98b594d;hb=c148615e9e7296869f95895ef434fd8371d637c2;hp=48a5602c33c32688762c998d13fd9ab4d54b2261;hpb=16984853e12058bd51b2e5ac065ed84febebc162;p=vchess.git diff --git a/public/javascripts/base_rules.js b/public/javascripts/base_rules.js index 48a5602c..172f68b4 100644 --- a/public/javascripts/base_rules.js +++ b/public/javascripts/base_rules.js @@ -821,7 +821,9 @@ class ChessRules this.shouldReturn = false; const maxeval = VariantRules.INFINITY; const color = this.turn; - let moves1 = this.getAllValidMoves(); + // Some variants may show a bigger moves list to the human (Switching), + // thus the argument "computer" below (which is generally ignored) + let moves1 = this.getAllValidMoves("computer"); // Can I mate in 1 ? (for Magnetic & Extinction) for (let i of _.shuffle(_.range(moves1.length))) @@ -843,7 +845,7 @@ class ChessRules { eval2 = (color=="w" ? 1 : -1) * maxeval; //initialized with checkmate value // Second half-move: - let moves2 = this.getAllValidMoves(); + let moves2 = this.getAllValidMoves("computer"); for (let j=0; j