aboutsummaryrefslogtreecommitdiff
path: root/src/board
diff options
context:
space:
mode:
Diffstat (limited to 'src/board')
-rw-r--r--src/board/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/board/mod.rs b/src/board/mod.rs
index cce2ca7..76ebd59 100644
--- a/src/board/mod.rs
+++ b/src/board/mod.rs
@@ -322,7 +322,7 @@ impl Board {
king_home_position.west_one().west_one(),
];
- let all_empty = castle_line.iter().all(|square| empty & square.to_bitboard() > 0);
+ let all_empty = castle_line.iter().skip(1).all(|square| empty & square.to_bitboard() > 0);
let any_checks = castle_line.iter().any(|square| self.is_square_attacked(*square, color.flip()));
if all_empty && !any_checks && self.castling_rights[color as usize][CastlingSide::Queen as usize] {
@@ -340,7 +340,7 @@ impl Board {
king_home_position.east_one().east_one(),
];
- let all_empty = castle_line.iter().all(|square| empty & square.to_bitboard() > 0);
+ let all_empty = castle_line.iter().skip(1).all(|square| empty & square.to_bitboard() > 0);
let any_checks = castle_line.iter().any(|square| self.is_square_attacked(*square, color.flip()));
if all_empty && !any_checks && self.castling_rights[color as usize][CastlingSide::King as usize] {