aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/board.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/board.rs b/src/board.rs
index 54efab9..625711e 100644
--- a/src/board.rs
+++ b/src/board.rs
@@ -152,8 +152,14 @@ impl Board {
for target in serialize_bitboard(self.attacks.pawn[color as usize][source as usize] & opponent_occupancy) {
moves.push(Move { source, target });
};
+ }
+ for source in serialize_bitboard(*piece) {
for target in serialize_bitboard(self.attacks.pawn_pushes[color as usize][source as usize] & available_targets) {
- moves.push(Move { source, target });
+ // Exclude double pushes in a monkey way
+ // TODO: properly rewrite this storing a separate bitboard for double pushes
+ if !((source as u8 / 8 == 1) && (target as u8 / 8 == 3) && (self.occupancy & (1 << (source as u8 + 8)) > 0)) {
+ moves.push(Move { source, target });
+ }
};
}
}