From 21281599140d827ac6149b8af8a56f9034851366 Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Sun, 2 Feb 2025 23:33:29 +0100 Subject: [PATCH] make_move now handles promotion --- cpp/src/board.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpp/src/board.cpp b/cpp/src/board.cpp index 2303e74..ae3be04 100644 --- a/cpp/src/board.cpp +++ b/cpp/src/board.cpp @@ -184,6 +184,10 @@ 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; + + // -- Handle promotion + if (move.promoting_to != 0) + ret.squares[move.target_square] = move.promoting_to; return ret; }