update main
authorBenjamin Auder <benjamin.auder@somewhere>
Wed, 1 Apr 2026 11:43:40 +0000 (13:43 +0200)
committerBenjamin Auder <benjamin.auder@somewhere>
Wed, 1 Apr 2026 11:43:40 +0000 (13:43 +0200)
variants/Eightpieces/class.js

index 527d2b0..1b50694 100644 (file)
@@ -142,10 +142,10 @@ export default class EightpiecesRules extends ChessRules {
       let [i, j] = this.increment([x, y], step);
       if (
         this.onBoard(i, j) &&
       let [i, j] = this.increment([x, y], step);
       if (
         this.onBoard(i, j) &&
-        this.board[i][j] == 'j' &&
+        this.getPiece(i, j) == 'j' &&
         this.getColor(i, j) == oppCol
       ) {
         this.getColor(i, j) == oppCol
       ) {
-          return true;
+        return true;
       }
     }
     return false;
       }
     }
     return false;
@@ -188,6 +188,10 @@ export default class EightpiecesRules extends ChessRules {
     return finalMoves;
   }
 
     return finalMoves;
   }
 
+  underAttack() {
+    // TODO: check enemy sentry(ies), for each, check all of our own pieces which attack the square (if belonging to opponent!). Then, call :
+    return super.undeerAttack();
+  }
 
   // Lazy sentry attacks check: after push move
   filterValid(moves, color) {
 
   // Lazy sentry attacks check: after push move
   filterValid(moves, color) {