diff options
author | eug-vs <eugene@eug-vs.xyz> | 2023-01-23 10:47:34 +0300 |
---|---|---|
committer | eug-vs <eugene@eug-vs.xyz> | 2023-01-23 10:47:34 +0300 |
commit | f8a5ce833e9bac0321579922445b8ca96a7bcf11 (patch) | |
tree | 45cf754d8e4a09accdb408e573f46808f8aa0e94 /src/board.rs | |
parent | 86b2729b7a4385da7d36b0c6296684cf62462654 (diff) | |
download | chessnost-f8a5ce833e9bac0321579922445b8ca96a7bcf11.tar.gz |
fix: do not push pawns into other pieces
Diffstat (limited to 'src/board.rs')
-rw-r--r-- | src/board.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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 }); }; } |