Fix en passant in FEN for grand in CECP
authorFabian Fichter <ianfab@users.noreply.github.com>
Fri, 19 Mar 2021 23:44:19 +0000 (00:44 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Fri, 19 Mar 2021 23:44:19 +0000 (00:44 +0100)
Closes #282.

src/position.cpp

index 5d42d30..9eef9ed 100644 (file)
@@ -390,6 +390,11 @@ Position& Position::set(const Variant* v, const string& fenStr, bool isChess960,
                && ((ss >> row) && (row >= '1' && row <= '1' + max_rank())))
       {
           st->epSquare = make_square(File(col - 'a'), Rank(row - '1'));
+#ifdef LARGEBOARDS
+          // Consider different rank numbering in CECP
+          if (max_rank() == RANK_10 && Options["Protocol"] == "xboard")
+              st->epSquare += NORTH;
+#endif
 
           // En passant square will be considered only if
           // a) side to move have a pawn threatening epSquare