From c3c14e7882bddc0153a49450cf271e096a3fbede Mon Sep 17 00:00:00 2001 From: Daniel Weber Date: Mon, 2 Jan 2023 16:44:38 -0500 Subject: [PATCH] Fix bug where pawns could eat people on the opposite side of the board. --- src/chess_board.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/chess_board.cpp b/src/chess_board.cpp index da87125..53ec901 100644 --- a/src/chess_board.cpp +++ b/src/chess_board.cpp @@ -386,8 +386,14 @@ static void Mark_Potential_Moves(uint8_t piece, uint8_t column, uint8_t row) } pawn_move(temp_row, column); - pawn_take(temp_row, column - 1u, piece); - pawn_take(temp_row, column + 1u, piece); + if(column != 0) + { + pawn_take(temp_row, column - 1u, piece); + } + if(column != 7u) + { + pawn_take(temp_row, column + 1u, piece); + } break; }