Almost added TitanChess + EvolutionChess
[vchess.git] / client / src / variants / Antiking1.js
index ac28c31..92034a3 100644 (file)
@@ -4,6 +4,7 @@ import { ArrayFun } from "@/utils/array";
 import { randInt } from "@/utils/alea";
 
 export class Antiking1Rules extends BerolinaRules {
+
   static get PawnSpecs() {
     return Object.assign(
       {},
@@ -56,7 +57,7 @@ export class Antiking1Rules extends BerolinaRules {
             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;
           }
         }
@@ -176,7 +177,8 @@ export class Antiking1Rules extends BerolinaRules {
     return res;
   }
 
-  getCheckSquares(color) {
+  getCheckSquares() {
+    const color = this.turn;
     let res = [];
     const oppCol = V.GetOppCol(color);
     if (this.isAttacked(this.kingPos[color], oppCol))
@@ -220,4 +222,5 @@ export class Antiking1Rules extends BerolinaRules {
   static get SEARCH_DEPTH() {
     return 2;
   }
+
 };