X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FCheckered.js;h=6864673c0cc6a5bf1f6d021104675a465fd9ceb7;hp=4a9419a8ad88e7d36953d01881181dd6eee81c61;hb=26b8e4f7c71030d49e44fe1d89632ef91b886d67;hpb=c018b304ba439ca92348dcb65715707f5cfcee05 diff --git a/public/javascripts/variants/Checkered.js b/public/javascripts/variants/Checkered.js index 4a9419a8..6864673c 100644 --- a/public/javascripts/variants/Checkered.js +++ b/public/javascripts/variants/Checkered.js @@ -181,15 +181,15 @@ class CheckeredRules extends ChessRules underCheck(color) { - return this.isAttacked(this.kingPos[color], [this.getOppCol(color),'c']); + return this.isAttacked(this.kingPos[color], [V.GetOppCol(color),'c']); } getCheckSquares(color) { // Artifically change turn, for checkered pawns - this.turn = this.getOppCol(color); + this.turn = V.GetOppCol(color); const kingAttacked = this.isAttacked( - this.kingPos[color], [this.getOppCol(color),'c']); + this.kingPos[color], [V.GetOppCol(color),'c']); let res = kingAttacked ? [JSON.parse(JSON.stringify(this.kingPos[color]))] //need to duplicate! : []; @@ -210,11 +210,11 @@ class CheckeredRules extends ChessRules { const color = this.turn; // Artifically change turn, for checkered pawns - this.turn = this.getOppCol(this.turn); - const res = this.isAttacked(this.kingPos[color], [this.getOppCol(color),'c']) + this.turn = V.GetOppCol(this.turn); + const res = this.isAttacked(this.kingPos[color], [V.GetOppCol(color),'c']) ? (color == "w" ? "0-1" : "1-0") : "1/2"; - this.turn = this.getOppCol(this.turn); + this.turn = V.GetOppCol(this.turn); return res; }