[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:
parent
c5cc0646ef
commit
9972ce94d0
1 changed files with 4 additions and 1 deletions
|
@ -321,7 +321,10 @@ impl<T: BoardProvider> MakeMoveInternal for T {
|
||||||
board.revoke_castling_right(None, Wing::QueenSide);
|
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);
|
||||||
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue