mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 09:13:08 +00:00
Fix book file regression
Revision 2aac860db3
of 27 / 4 / 2012
changed can_castle() signatures from bool to int and
this broke the code that calculates polyglot hash key
in book.cpp
Instead of directly fixing the code we prefer to change
castling rights definitions to align to the polyglot ones
(as we did in previous patch). After this step we can simply
take internal castle rights as they are and use them
directly to calculate polyglot book hash key, as we do
in this patch that fixes the regression.
No functional change.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
a358dfe934
commit
6c9c6dd989
1 changed files with 1 additions and 2 deletions
|
@ -323,8 +323,7 @@ namespace {
|
|||
key ^= ZobPiece[PieceOffset[pos.piece_on(s)] + s];
|
||||
}
|
||||
|
||||
b = (pos.can_castle(WHITE_OO) << 0) | (pos.can_castle(WHITE_OOO) << 1)
|
||||
| (pos.can_castle(BLACK_OO) << 2) | (pos.can_castle(BLACK_OOO) << 3);
|
||||
b = pos.can_castle(ALL_CASTLES);
|
||||
|
||||
while (b)
|
||||
key ^= ZobCastle[pop_1st_bit(&b)];
|
||||
|
|
Loading…
Add table
Reference in a new issue