Skip to content

Commit

Permalink
fix: fixed king at check
Browse files Browse the repository at this point in the history
  • Loading branch information
Saphereye committed Sep 24, 2024
1 parent 1446000 commit 2a1e33e
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/definitions/board.rs
Original file line number Diff line number Diff line change
Expand Up @@ -624,10 +624,6 @@ impl Board {
}
}

if self.is_square_attacked(&self.king_square[Color::White as usize], &Color::Black) {
return moves;
}

// White pawns
for white_pawn in &self.piece_list[Piece::WP as usize] {
// The pawn is not on board
Expand Down Expand Up @@ -903,10 +899,6 @@ impl Board {
}
}

if self.is_square_attacked(&self.king_square[Color::Black as usize], &Color::White) {
return moves;
}

// Black pawns
for black_pawn in &self.piece_list[Piece::BP as usize] {
if *black_pawn == Square::None {
Expand Down

0 comments on commit 2a1e33e

Please sign in to comment.