X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=public%2Fjavascripts%2Fvariants%2FDark.js;h=79d27b5b35acf34bba07be779c5c8a833440d6d7;hb=b6487fb9c41705187cf97215fc9e8f86a59057c7;hp=96f50de794027e887aa552c5534a94735847f4e9;hpb=5915f72002ae63b04620cebe47adf778174b1bee;p=vchess.git diff --git a/public/javascripts/variants/Dark.js b/public/javascripts/variants/Dark.js index 96f50de7..79d27b5b 100644 --- a/public/javascripts/variants/Dark.js +++ b/public/javascripts/variants/Dark.js @@ -16,15 +16,37 @@ class DarkRules extends ChessRules updateEnlightened() { - // Initialize with pieces positions (which are seen) for (let i=0; i 0) - { - this.kingPos[c][0] = move.appear[0].x; - this.kingPos[c][1] = move.appear[0].y; - } + super.updateVariables(move); if (move.vanish.length >= 2 && move.vanish[1].p == V.KING) { // We took opponent king ! - const oppCol = this.getOppCol(c); - this.kingPos[oppCol] = [-1,-1]; + this.kingPos[this.turn] = [-1,-1]; } // Update moves for both colors: