X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=client%2Fsrc%2Fvariants%2FTwokings.js;h=d56d095188b54cb25f20ea96e07e5c1a59dfb66a;hb=c3ff3a0c807d97c0311a06491318fe02440266db;hp=ce30d65378b3e6babbd4b0d546626958bc8f911a;hpb=305ede7ec3753fc669b7c86af5b5c5b2fc78a164;p=vchess.git diff --git a/client/src/variants/Twokings.js b/client/src/variants/Twokings.js index ce30d653..d56d0951 100644 --- a/client/src/variants/Twokings.js +++ b/client/src/variants/Twokings.js @@ -21,7 +21,7 @@ export class TwokingsRules extends CoregalRules { if (['K','k'].includes(row[i])) kings[row[i]]++; if (V.PIECES.includes(row[i].toLowerCase())) sumElts++; else { - const num = parseInt(row[i]); + const num = parseInt(row[i], 10); if (isNaN(num)) return false; sumElts += num; } @@ -34,9 +34,10 @@ export class TwokingsRules extends CoregalRules { } // Not scanning king positions. In this variant, scan the board everytime. - scanKings(fen) {} + scanKings() {} - getCheckSquares(color) { + getCheckSquares() { + const color = this.turn; let squares = []; const oppCol = V.GetOppCol(color); for (let i=0; i