Fix: Pawns don't all promote into black pieces anymore

master
Dany Thach 2025-02-28 22:03:51 +01:00
parent 00f371b913
commit 176fdd42d1
1 changed files with 2 additions and 2 deletions

View File

@ -217,7 +217,7 @@ class Position {
}
enPassantTargetSquare = (startSquare - endSquare == 16) ? startSquare - 8 : null;
if (endSquare < 8) {
board[endSquare] = Piece.pieceByFenCharacter[promotingPiece]!;
board[endSquare] = Piece.pieceByFenCharacter[promotingPiece?.toUpperCase()]!;
}
return;
}
@ -263,7 +263,7 @@ class Position {
}
enPassantTargetSquare = (endSquare - startSquare == 16) ? startSquare + 8 : null;
if (endSquare > 55) {
board[endSquare] = Piece.pieceByFenCharacter[promotingPiece]!;
board[endSquare] = Piece.pieceByFenCharacter[promotingPiece?.toLowerCase()]!;
}
return;
}