X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=07680f1d1830e4447c7f61da25be41407bc69510;hp=c9526ec3c683e38a013089dfcd98bb661f3f2c0e;hb=b9f1c9bf3f5ba240423a4f1ca8a2fb0f975a775e;hpb=3f1eb85a1ceb1b408f8f51cb82064b69e095399d diff --git a/src/search.cpp b/src/search.cpp index c9526ec3..07680f1d 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -187,6 +187,7 @@ void Search::clear() { Time.availableNodes = 0; TT.clear(); Threads.clear(); + Tablebases::init(Options["SyzygyPath"]); // Free up mapped files } @@ -943,6 +944,12 @@ moves_loop: // When in check, search starts from here && pos.see_ge(move)) extension = ONE_PLY; + // Extension for king moves that change castling rights + if ( pos.can_castle(us) + && type_of(movedPiece) == KING + && depth < 12 * ONE_PLY) + extension = ONE_PLY; + // Calculate new depth for this move newDepth = depth - ONE_PLY + extension;