Skip to content

Commit

Permalink
Ajout test couleur dans la fonction de la liste des mouvements du pion
Browse files Browse the repository at this point in the history
Co-authored-by: Mamm846 <[email protected]>
  • Loading branch information
qhorgues and Mamm846 committed Mar 8, 2024
1 parent 232dedc commit 41c05fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Piece/Piece.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ Piece::get_list_move_pawn(Board<N, M> 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))
Expand Down

0 comments on commit 41c05fc

Please sign in to comment.