X-Git-Url: https://git.auder.net/?p=vchess.git;a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FMagnetic.js;h=8adb1babd4cbcc5b75f3ba27674c5bd9ab4b2ad3;hp=7b0d096ced0410205ee95c5949ecd70a0ac157f7;hb=26b8e4f7c71030d49e44fe1d89632ef91b886d67;hpb=c018b304ba439ca92348dcb65715707f5cfcee05 diff --git a/public/javascripts/variants/Magnetic.js b/public/javascripts/variants/Magnetic.js index 7b0d096c..8adb1bab 100644 --- a/public/javascripts/variants/Magnetic.js +++ b/public/javascripts/variants/Magnetic.js @@ -156,14 +156,14 @@ class MagneticRules extends ChessRules if (move.vanish.length >= 2 && move.vanish[1].p == V.KING) { // We took opponent king ! - const oppCol = this.getOppCol(c); + const oppCol = V.GetOppCol(c); this.kingPos[oppCol] = [-1,-1]; this.castleFlags[oppCol] = [false,false]; } // Did we magnetically move our (init) rooks or opponents' ones ? const firstRank = (c == "w" ? 7 : 0); const oppFirstRank = 7 - firstRank; - const oppCol = this.getOppCol(c); + const oppCol = V.GetOppCol(c); move.vanish.forEach(psq => { if (psq.x == firstRank && this.INIT_COL_ROOK[c].includes(psq.y)) this.castleFlags[c][psq.y==this.INIT_COL_ROOK[c][0] ? 0 : 1] = false; @@ -176,7 +176,7 @@ class MagneticRules extends ChessRules { super.unupdateVariables(move); const c = move.vanish[0].c; - const oppCol = this.getOppCol(c); + const oppCol = V.GetOppCol(c); if (this.kingPos[oppCol][0] < 0) { // Last move took opponent's king