projects
/
fairystockfish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
57bda21
)
Fix castling rights for passing moves
author
Fabian Fichter
<ianfab@users.noreply.github.com>
Sat, 13 Nov 2021 12:15:07 +0000 (13:15 +0100)
committer
Fabian Fichter
<ianfab@users.noreply.github.com>
Sat, 13 Nov 2021 12:16:04 +0000 (13:16 +0100)
src/position.cpp
patch
|
blob
|
history
diff --git
a/src/position.cpp
b/src/position.cpp
index
3a06a42
..
239d961
100644
(file)
--- a/
src/position.cpp
+++ b/
src/position.cpp
@@
-1475,7
+1475,7
@@
void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
}
// Update castling rights if needed
- if (type_of(m) != DROP && st->castlingRights && (castlingRightsMask[from] | castlingRightsMask[to]))
+ if (type_of(m) != DROP && !is_pass(m) && st->castlingRights && (castlingRightsMask[from] | castlingRightsMask[to]))
{
k ^= Zobrist::castling[st->castlingRights];
st->castlingRights &= ~(castlingRightsMask[from] | castlingRightsMask[to]);