]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Do not prune the move if we are still under mate
[stockfish] / src / search.cpp
index c0b6507ce9ecddeffac44bc2bea2df64ed7d2de7..53811de04701c4705053dc0d3ed1e52049db0aed 100644 (file)
@@ -1369,7 +1369,8 @@ namespace {
       {
           // History pruning. See ok_to_prune() definition
           if (   moveCount >= 2 + int(depth)
       {
           // History pruning. See ok_to_prune() definition
           if (   moveCount >= 2 + int(depth)
-              && ok_to_prune(pos, move, ss[ply].threatMove, depth))
+              && ok_to_prune(pos, move, ss[ply].threatMove, depth)
+              && bestValue > value_mated_in(PLY_MAX))
               continue;
 
           // Value based pruning
               continue;
 
           // Value based pruning