From e9c96e83daa5d2a3a73ee64bac43bccd58c2a403 Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Tue, 4 Feb 2025 21:50:30 +0100 Subject: [PATCH] fixed en passant offset --- cpp/src/board.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/src/board.cpp b/cpp/src/board.cpp index 6e65fd1..b8c1f43 100644 --- a/cpp/src/board.cpp +++ b/cpp/src/board.cpp @@ -183,7 +183,8 @@ Board Board::make_move(Move move) const { // -- Handle en passant target being eaten if (move.en_passant) - ret.squares[move.target_square - 8] = Piece::None; + ret.squares[move.target_square + (white_to_play ? -8 : 8)] = + Piece::None; // -- Handle promotion if (move.promoting_to != Piece::None)