X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=006309ea0e1251ec405f0bec2ccf2bc024c631d2;hp=ec54da9e9e3161b382120acfaadfe7c9866129fd;hb=6a8cfe79da1b645ba3196458aca0e2c7247cbba2;hpb=1f97b48a31cd60d71c5fb63541cbf3991a094443 diff --git a/src/position.cpp b/src/position.cpp index ec54da9e..006309ea 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -725,16 +725,14 @@ void Position::update_hidden_checks(Square from, Square to) { if ( (moveSquares & RookPseudoAttacks[ksq]) && (checkerCaptured || (rooks_and_queens(them) & RookPseudoAttacks[ksq])) || (moveSquares & BishopPseudoAttacks[ksq]) && (checkerCaptured || (bishops_and_queens(them) & BishopPseudoAttacks[ksq]))) { + find_hidden_checks(them, Pinned); // If we don't have opponent dc candidates and we are moving in the - // attack line then won't be dc candidates also after the move. + // attack line then won't be any dc candidates also after the move. if ( st->dcCandidates[them] - || bit_is_set(RookPseudoAttacks[ksq], from) - || bit_is_set(BishopPseudoAttacks[ksq], from)) - - find_hidden_checks(them, Pinned | DcCandidates); - else - find_hidden_checks(them, Pinned); + || (bit_is_set(RookPseudoAttacks[ksq], from) && (rooks_and_queens(them) & RookPseudoAttacks[ksq])) + || (bit_is_set(BishopPseudoAttacks[ksq], from) && (bishops_and_queens(them) & BishopPseudoAttacks[ksq]))) + find_hidden_checks(them, DcCandidates); } }