From 41c05fc882d853089b9bb4ae82df511d135d0598 Mon Sep 17 00:00:00 2001 From: Quentin Horgues <77660464+qhorgues@users.noreply.github.com> Date: Fri, 8 Mar 2024 10:54:09 +0100 Subject: [PATCH] Ajout test couleur dans la fonction de la liste des mouvements du pion Co-authored-by: Mamm846 --- src/Piece/Piece.tpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Piece/Piece.tpp b/src/Piece/Piece.tpp index f41c1f3..9184b41 100644 --- a/src/Piece/Piece.tpp +++ b/src/Piece/Piece.tpp @@ -263,7 +263,7 @@ Piece::get_list_move_pawn(Board const &board, Coord const &pos) const if (arv >= 0) { std::size_t n{arv / N}, m{arv % N}; - if (board(n, m) != nullptr || + if ((board(n, m) != nullptr && !same_color(*board(n, m))) || (board.m_ep != std::nullopt && board.m_ep->n == pos.n && board.m_ep->m == pos.m))