Skip to content

Commit

Permalink
Fixed promotions not being detected from the position command, causin…
Browse files Browse the repository at this point in the history
…g illegal moves to be made after promotions

Bench: 6493900
  • Loading branch information
Dannyj1 committed Jan 24, 2023
1 parent 31fa7ce commit 51c90f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/bitboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ namespace Zagreus {
}
}

Move move = {fromSquare, toSquare, getPieceOnSquare(fromSquare), promotionPiece};
Move move = {fromSquare, toSquare, getPieceOnSquare(fromSquare), -1, promotionPiece};
makeMove(move);
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions src/bitboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ namespace Zagreus {

assert(movingPiece != PieceType::EMPTY);
assert(capturedPieceType != PieceType::EMPTY);
Move move{fromSquare, toSquare, movingPiece, PieceType::EMPTY};
Move move{fromSquare, toSquare, movingPiece};
makeMove(move);

if (attackingColor == PieceColor::WHITE) {
Expand Down Expand Up @@ -338,7 +338,7 @@ namespace Zagreus {

assert(movingPiece != PieceType::EMPTY);
assert(capturedPieceType != PieceType::EMPTY);
Move move{smallestAttackerSquare, square, movingPiece, PieceType::EMPTY};
Move move{smallestAttackerSquare, square, movingPiece};
makeMove(move);

if (attackingColor == PieceColor::WHITE) {
Expand Down

0 comments on commit 51c90f1

Please sign in to comment.