Fix wrong knightrider french translation
[vchess.git] / client / src / variants / Atomic2.js
index 9ea2296..54ffb17 100644 (file)
@@ -23,10 +23,16 @@ export class Atomic2Rules extends Atomic1Rules {
     return super.getPotentialMovesFrom([x, y]);
   }
 
-  hoverHighlight(x, y) {
+  hoverHighlight([x, y]) {
     return this.movesCount == 0 && [1, 6].includes(x);
   }
 
+  canIplay(side, [x, y]) {
+    if (this.movesCount == 0)
+      return (this.turn == side && this.getPiece(x, y) == V.PAWN);
+    return super.canIplay(side, [x, y]);
+  }
+
   doClick(square) {
     if (this.movesCount >= 1) return null;
     const [x, y] = [square[0], square[1]];