X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fbase_rules.js;fp=public%2Fjavascripts%2Fbase_rules.js;h=4b0b470521bac7b394d8234386bae0bd3100f31c;hb=baba60703f661aab20f2327098c3a0af572f0704;hp=718261d2a3509f1fad550324c0c4dd2dece050ad;hpb=fd08ab2c5b8931bb8c95cf7e9f2f95122647f991;p=vchess.git diff --git a/public/javascripts/base_rules.js b/public/javascripts/base_rules.js index 718261d2..4b0b4705 100644 --- a/public/javascripts/base_rules.js +++ b/public/javascripts/base_rules.js @@ -221,7 +221,7 @@ class ChessRules // On which squares is color under check ? (for interface) getCheckSquares(color) { - return this.isAttacked(this.kingPos[color], [this.getOppCol(color)]) + return this.isAttacked(this.kingPos[color], [V.GetOppCol(color)]) ? [JSON.parse(JSON.stringify(this.kingPos[color]))] //need to duplicate! : []; } @@ -280,7 +280,7 @@ class ChessRules return pieces["b"].join("") + "/pppppppp/8/8/8/8/PPPPPPPP/" + pieces["w"].join("").toUpperCase() + - " w 1111 -"; //add turn + flags + enpassant + " w 0 1111 -"; //add turn + flags + enpassant } // "Parse" FEN: just return untransformed string data @@ -734,7 +734,7 @@ class ChessRules return []; //x isn't first rank, or king has moved (shortcut) // Castling ? - const oppCol = this.getOppCol(c); + const oppCol = V.GetOppCol(c); let moves = []; let i = 0; const finalSquares = [ [2,3], [V.size.y-2,V.size.y-3] ]; //king, then rook @@ -824,7 +824,7 @@ class ChessRules getAllValidMoves() { const color = this.turn; - const oppCol = this.getOppCol(color); + const oppCol = V.GetOppCol(color); let potentialMoves = []; for (let i=0; i