Fix Progressive2. Fixing attempt on Doublemove1
[vchess.git] / client / src / variants / Suicide.js
index c81d355..e3630bb 100644 (file)
@@ -7,10 +7,6 @@ export class SuicideRules extends ChessRules {
     return false;
   }
 
-  static get HasCastle() {
-    return false;
-  }
-
   static get PawnSpecs() {
     return Object.assign(
       {},
@@ -33,7 +29,7 @@ export class SuicideRules extends ChessRules {
           pieces[row[i] == lowerRi ? "b" : "w"]++;
           sumElts++;
         } else {
-          const num = parseInt(row[i]);
+          const num = parseInt(row[i], 10);
           if (isNaN(num)) return false;
           sumElts += num;
         }
@@ -54,12 +50,11 @@ export class SuicideRules extends ChessRules {
   // Stop at the first capture found (if any)
   atLeastOneCapture() {
     const color = this.turn;
-    const oppCol = V.GetOppCol(color);
     for (let i = 0; i < V.size.x; i++) {
       for (let j = 0; j < V.size.y; j++) {
         if (
           this.board[i][j] != V.EMPTY &&
-          this.getColor(i, j) != oppCol &&
+          this.getColor(i, j) == color &&
           this.getPotentialMovesFrom([i, j]).some(m => m.vanish.length == 2)
         ) {
           return true;