Fist draft of Antiking variant (still being debugged)
[vchess.git] / public / javascripts / base_rules.js
index 0868a36..8626b88 100644 (file)
@@ -621,7 +621,7 @@ class ChessRules
        getCheckSquares(move)
        {
                this.play(move);
-               const color = this.turn;
+               const color = this.turn; //opponent
                let res = this.isAttacked(this.kingPos[color], this.getOppCol(color))
                        ? [ JSON.parse(JSON.stringify(this.kingPos[color])) ] //need to duplicate!
                        : [ ];
@@ -1030,7 +1030,7 @@ class ChessRules
                let pgn = "";
                pgn += '[Site "vchess.club"]<br>';
                const d = new Date();
-               const opponent = this.mode=="human" ? "Anonymous" : "Computer";
+               const opponent = mode=="human" ? "Anonymous" : "Computer";
                pgn += '[Date "' + d.getFullYear() + '-' + (d.getMonth()+1) + '-' + d.getDate() + '"]<br>';
                pgn += '[White "' + (mycolor=='w'?'Myself':opponent) + '"]<br>';
                pgn += '[Black "' + (mycolor=='b'?'Myself':opponent) + '"]<br>';