Fix parseInt() usage, rename Doubleorda --> Ordamirror, implement Clorange variant
[vchess.git] / client / src / variants / Twokings.js
index ce30d65..d56d095 100644 (file)
@@ -21,7 +21,7 @@ export class TwokingsRules extends CoregalRules {
         if (['K','k'].includes(row[i])) kings[row[i]]++;
         if (V.PIECES.includes(row[i].toLowerCase())) sumElts++;
         else {
-          const num = parseInt(row[i]);
+          const num = parseInt(row[i], 10);
           if (isNaN(num)) return false;
           sumElts += num;
         }
@@ -34,9 +34,10 @@ export class TwokingsRules extends CoregalRules {
   }
 
   // Not scanning king positions. In this variant, scan the board everytime.
-  scanKings(fen) {}
+  scanKings() {}
 
-  getCheckSquares(color) {
+  getCheckSquares() {
+    const color = this.turn;
     let squares = [];
     const oppCol = V.GetOppCol(color);
     for (let i=0; i<V.size.x; i++) {