Fix parseInt() usage, rename Doubleorda --> Ordamirror, implement Clorange variant
[vchess.git] / client / src / variants / Antiking2.js
index 2dad5e4..762ca5c 100644 (file)
@@ -43,7 +43,7 @@ export class Antiking2Rules extends ChessRules {
             this.antikingPos["w"] = [i, k];
             break;
           default: {
-            const num = parseInt(rows[i].charAt(j));
+            const num = parseInt(rows[i].charAt(j), 10);
             if (!isNaN(num)) k += num - 1;
           }
         }
@@ -117,7 +117,8 @@ export class Antiking2Rules extends ChessRules {
     return res;
   }
 
-  getCheckSquares(color) {
+  getCheckSquares() {
+    const color = this.turn;
     let res = [];
     const oppCol = V.GetOppCol(color);
     if (this.isAttacked(this.kingPos[color], oppCol))