X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fsearch.cpp;h=025c1141c97546e6e98693877fad9afff26336d5;hb=91a76331ca27b40d63f0031fbd7b9e41ead354d4;hp=1a4f654d10539a998cc248a5fa5c0c2d2f0eade9;hpb=aacee91a5a295f1d9de2ea6dc0ca4a48e934e3b6;p=stockfish diff --git a/src/search.cpp b/src/search.cpp index 1a4f654d..025c1141 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -577,6 +577,17 @@ namespace { beta = std::min(mate_in(ss->ply+1), beta); if (alpha >= beta) return alpha; + + // Check if there exists a move which draws by repetition, or an alternative + // earlier move to this position. + if ( pos.rule50_count() >= 3 + && alpha < VALUE_DRAW + && pos.has_game_cycle(ss->ply)) + { + alpha = VALUE_DRAW; + if (alpha >= beta) + return alpha; + } } assert(0 <= ss->ply && ss->ply < MAX_PLY);