X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FAntiking.js;h=84f774a583a7ff810f84c4c23e3d825038386785;hb=cf1303697774a12ef9bb154014a38797716944cf;hp=f8c7465aeeed1cfc683c00b11b8c4c315efc90fb;hpb=efb20746c30ac26f258f9c5de6dfb70b91980de4;p=vchess.git diff --git a/public/javascripts/variants/Antiking.js b/public/javascripts/variants/Antiking.js index f8c7465a..84f774a5 100644 --- a/public/javascripts/variants/Antiking.js +++ b/public/javascripts/variants/Antiking.js @@ -92,8 +92,8 @@ class AntikingRules extends ChessRules const c = this.turn; const oppCol = this.getOppCol(c); this.play(move) - let res = this.isAttacked(this.kingPos[c], oppCol) - || !this.isAttacked(this.antikingPos[c], oppCol); + let res = this.isAttacked(this.kingPos[c], [oppCol]) + || !this.isAttacked(this.antikingPos[c], [oppCol]); this.undo(move); return res; } @@ -103,7 +103,7 @@ class AntikingRules extends ChessRules let res = super.getCheckSquares(move); this.play(move); const c = this.turn; - if (!this.isAttacked(this.antikingPos[c], this.getOppCol(c))) + if (!this.isAttacked(this.antikingPos[c], [this.getOppCol(c)])) res.push(JSON.parse(JSON.stringify(this.antikingPos[c]))); this.undo(move); return res; @@ -134,8 +134,8 @@ class AntikingRules extends ChessRules { const color = this.turn; const oppCol = this.getOppCol(color); - if (!this.isAttacked(this.kingPos[color], oppCol) - && this.isAttacked(this.antikingPos[color], oppCol)) + if (!this.isAttacked(this.kingPos[color], [oppCol]) + && this.isAttacked(this.antikingPos[color], [oppCol])) { return "1/2"; }