projects
/
fairystockfish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
711829f
)
Fix castling initialization for placement chess
author
Fabian Fichter
<ianfab@users.noreply.github.com>
Fri, 12 Mar 2021 18:20:41 +0000 (19:20 +0100)
committer
Fabian Fichter
<ianfab@users.noreply.github.com>
Fri, 12 Mar 2021 18:20:41 +0000 (19:20 +0100)
Refactoring of 960 castling broke placement chess castling.
Add initialization of king position to prevent undefined behavior.
src/position.cpp
patch
|
blob
|
history
diff --git
a/src/position.cpp
b/src/position.cpp
index
d9deef6
..
3622b30
100644
(file)
--- a/
src/position.cpp
+++ b/
src/position.cpp
@@
-1498,6
+1498,7
@@
void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) {
{
if (type_of(pc) == castling_king_piece() && file_of(to) == castling_king_file())
{
+ st->castlingKingSquare[us] = to;
Bitboard castling_rooks = pieces(us, castling_rook_piece())
& rank_bb(castling_rank(us))
& (file_bb(FILE_A) | file_bb(max_file()));