X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=ad13c4ba304c1a898d0a5684504d68c7e7fee47b;hp=0cd490850cdbe57007053b4ed59bdc87131ddd72;hb=67f88f5e3e4ee6e4b49151173c2898253178506f;hpb=72e8640f4d98be6aefcf3d486e608da21ac44b2d diff --git a/src/search.cpp b/src/search.cpp index 0cd49085..ad13c4ba 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -512,7 +512,7 @@ namespace { { // Step 2. Check for aborted search and immediate draw if (Signals.stop || pos.is_draw() || ss->ply > MAX_PLY) - return DrawValue[pos.side_to_move()]; + return ss->ply > MAX_PLY && !inCheck ? evaluate(pos) : DrawValue[pos.side_to_move()]; // Step 3. Mate distance pruning. Even if we mate at the next move our score // would be at best mate_in(ss->ply+1), but if alpha is already bigger because @@ -1078,7 +1078,7 @@ moves_loop: // When in check and at SpNode search starts from here // Check for an instant draw or if the maximum ply has been reached if (pos.is_draw() || ss->ply > MAX_PLY) - return DrawValue[pos.side_to_move()]; + return ss->ply > MAX_PLY && !InCheck ? evaluate(pos) : DrawValue[pos.side_to_move()]; // Decide whether or not to include checks: this fixes also the type of // TT entry depth that we are going to use. Note that in qsearch we use