Debug en passant!

This commit is contained in:
Loic Guegan 2022-02-19 14:26:58 +01:00
parent 1e5a34d8d2
commit f60b684790
2 changed files with 23 additions and 0 deletions

View file

@ -110,6 +110,13 @@ bool ChessArbiter::Play(std::string move) {
} else if (!fen.player && (dst[1] - src[1] == 2)) {
newFen.en_passant = src[0] + std::string() + (char)(src[1] + 1);
}
if (dst == fen.en_passant) {
if (fen.player) {
board.RemovePiece(dst[0] + std::string() + (char)(dst[1] + 1));
} else {
board.RemovePiece(dst[0] + std::string() + (char)(dst[1] - 1));
}
}
newFen.halfmove = 0; // Pawn moves reset half moves
}
// Captures reset half moves