diff options
| author | Loic Guegan <manzerbredes@mailbox.org> | 2022-02-19 14:26:58 +0100 |
|---|---|---|
| committer | Loic Guegan <manzerbredes@mailbox.org> | 2022-02-19 14:26:58 +0100 |
| commit | f60b684790ae7a726763e4c6f9122371c71d17e9 (patch) | |
| tree | 568ee4b4c7f56ccc33cb82b080e2b99cca1e7efe /src/ChessArbiter.cpp | |
| parent | 1e5a34d8d2befa5786adc30e99d85372510f017f (diff) | |
Debug en passant!
Diffstat (limited to 'src/ChessArbiter.cpp')
| -rw-r--r-- | src/ChessArbiter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ChessArbiter.cpp b/src/ChessArbiter.cpp index 21d0bfa..18e1e1c 100644 --- a/src/ChessArbiter.cpp +++ b/src/ChessArbiter.cpp @@ -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 |
