mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Don't reset 50-move counter after castling
Rule says should be reset only after a capture and/or a pawn move. This incredible bug was here since Glaurung times ! Spotted by Kiriakos. No functional change in the test bench because we don't reach the 50 moves limits. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
576f0f6985
commit
86e159997c
1 changed files with 1 additions and 4 deletions
|
@ -752,7 +752,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
|
|||
k ^= zobSideToMove;
|
||||
|
||||
// Increment the 50 moves rule draw counter. Resetting it to zero in the
|
||||
// case of non-reversible moves is taken care of later.
|
||||
// case of a capture or a pawn move is taken care of later.
|
||||
st->rule50++;
|
||||
st->pliesFromNull++;
|
||||
|
||||
|
@ -1155,9 +1155,6 @@ void Position::do_castle_move(Move m) {
|
|||
st->castleRights &= castleRightsMask[kfrom];
|
||||
st->key ^= zobCastle[st->castleRights];
|
||||
|
||||
// Reset rule 50 counter
|
||||
st->rule50 = 0;
|
||||
|
||||
// Update checkers BB
|
||||
st->checkersBB = attackers_to(king_square(~us)) & pieces(us);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue