Fix parseInt() usage, rename Doubleorda --> Ordamirror, implement Clorange variant
[vchess.git] / client / src / variants / Horde.js
index 6305c41..c436811 100644 (file)
@@ -24,7 +24,7 @@ export class HordeRules extends ChessRules {
           }
           sumElts++;
         } else {
-          const num = parseInt(row[i]);
+          const num = parseInt(row[i], 10);
           if (isNaN(num)) return false;
           sumElts += num;
         }
@@ -51,8 +51,8 @@ export class HordeRules extends ChessRules {
     return super.filterValid(moves);
   }
 
-  getCheckSquares(color) {
-    if (color == 'w') return [];
+  getCheckSquares() {
+    if (this.turn == 'w') return [];
     return (
       this.underCheck('b')
         ? [JSON.parse(JSON.stringify(this.kingPos['b']))]