From 9972ce94d09674c78817ebefe09f43c9ea5dd7da Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 18 Jun 2025 08:25:41 -0700 Subject: [PATCH] [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. --- moves/src/make_move.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/moves/src/make_move.rs b/moves/src/make_move.rs index 7b8fd33..0ddeb1e 100644 --- a/moves/src/make_move.rs +++ b/moves/src/make_move.rs @@ -321,7 +321,10 @@ impl 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); + } _ => {} }