From f8a5ce833e9bac0321579922445b8ca96a7bcf11 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Mon, 23 Jan 2023 10:47:34 +0300 Subject: fix: do not push pawns into other pieces --- src/board.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/board.rs b/src/board.rs index bbcd5c7..d3c1666 100644 --- a/src/board.rs +++ b/src/board.rs @@ -156,7 +156,7 @@ impl Board { for target in serialize_bitboard(self.attacks.pawn[color as usize][source as usize] & opponent_occupancy) { moves.push(Move { source, target }); }; - for target in serialize_bitboard(self.attacks.pawn_pushes[color as usize][source as usize] & available_targets) { + for target in serialize_bitboard(self.attacks.pawn_pushes[color as usize][source as usize] & empty) { moves.push(Move { source, target }); }; } @@ -167,7 +167,7 @@ impl Board { Color::Black => empty << 8, }; for source in serialize_bitboard(*piece & able_to_double_push_mask) { - for target in serialize_bitboard(self.attacks.pawn_double_pushes[color as usize][source as usize] & available_targets) { + for target in serialize_bitboard(self.attacks.pawn_double_pushes[color as usize][source as usize] & empty) { moves.push(Move { source, target }); }; } -- cgit v1.2.3