Typo
[vchess.git] / client / src / variants / Checkered1.js
index fd0d68d..2451f9b 100644 (file)
@@ -1,6 +1,7 @@
 import { ChessRules, Move, PiPo } from "@/base_rules";
 
 export class Checkered1Rules extends ChessRules {
+
   static board2fen(b) {
     const checkered_codes = {
       p: "s",
@@ -503,9 +504,14 @@ export class Checkered1Rules extends ChessRules {
         this.kingPos[c][1] = move.appear[0].y;
       }
       super.updateCastleFlags(move, piece);
-      // Does this move turn off a 2-squares pawn flag?
-      if ([1, 6].includes(move.start.x) && move.vanish[0].p == V.PAWN)
+      if (
+        [1, 6].includes(move.start.x) &&
+        move.vanish[0].p == V.PAWN &&
+        Math.abs(move.end.x - move.start.x) == 2
+      ) {
+        // This move turns off a 2-squares pawn flag
         this.pawnFlags[move.start.x == 6 ? "w" : "b"][move.start.y] = false;
+      }
     }
     this.cmoves.push(this.getCmove(move));
   }
@@ -678,4 +684,5 @@ export class Checkered1Rules extends ChessRules {
       notation += "=" + move.appear[0].p.toUpperCase();
     return notation;
   }
+
 };