X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=5f0a0f3b901e1bbdbbafd89ebafd98e0ea5950f9;hp=c6d63c7bd2148ebfaa266b01b569dcfa7eb7d9c4;hb=20023ac9b8c28d8b15308d7bf5be4fad8501535d;hpb=3549d98d07a6f0d04e4d020e009903dd82d0fadf diff --git a/src/search.cpp b/src/search.cpp index c6d63c7b..5f0a0f3b 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1019,19 +1019,18 @@ moves_loop: // When in check search starts from here if (!PvNode && cutNode) r += ONE_PLY; - // Decrease/increase reduction for moves with a good/bad history - int rHist = (val - 10000) / 20000; - r = std::max(DEPTH_ZERO, r - rHist * ONE_PLY); - // Decrease reduction for moves that escape a capture. Filter out // castling moves, because they are coded as "king captures rook" and // hence break make_move(). Also use see() instead of see_sign(), // because the destination square is empty. - if ( r - && type_of(move) == NORMAL - && type_of(pos.piece_on(to_sq(move))) != PAWN - && pos.see(make_move(to_sq(move), from_sq(move))) < VALUE_ZERO) - r = std::max(DEPTH_ZERO, r - ONE_PLY); + else if ( type_of(move) == NORMAL + && type_of(pos.piece_on(to_sq(move))) != PAWN + && pos.see(make_move(to_sq(move), from_sq(move))) < VALUE_ZERO) + r -= ONE_PLY; + + // Decrease/increase reduction for moves with a good/bad history + int rHist = (val - 10000) / 20000; + r = std::max(DEPTH_ZERO, r - rHist * ONE_PLY); Depth d = std::max(newDepth - r, ONE_PLY);