[moves] Revoke castling rights only for the player that moved

There was a bug in the code that revokes castling rights after a king move where
it revoked the rights for *all* players, rather than just the current player.
Fix it.
This commit is contained in:
Eryn Wells 2025-06-18 08:25:41 -07:00
parent c5cc0646ef
commit 9972ce94d0

View file

@ -321,7 +321,10 @@ impl<T: BoardProvider> MakeMoveInternal for T {
board.revoke_castling_right(None, Wing::QueenSide);
}
}
Shape::King => board.revoke_all_castling_rights(),
Shape::King => {
board.revoke_castling_right(None, Wing::KingSide);
board.revoke_castling_right(None, Wing::QueenSide);
}
_ => {}
}