]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Merge branch 'master' into increase_iid
[stockfish] / src / search.cpp
index 8ef2513dd1a895c0fdda2ed28af7c5587f06de51..9ab8c800d8fbde01527d266b6a8fc1d0a9c314b8 100644 (file)
@@ -856,7 +856,8 @@ split_point_start: // At split points actual search starts from here
           && !captureOrPromotion
           && !inCheck
           && !dangerous
-          &&  move != ttMove)
+          &&  move != ttMove
+          &&  bestValue > VALUE_MATED_IN_MAX_PLY)
       {
           // Move count based pruning
           if (   depth < 16 * ONE_PLY
@@ -878,9 +879,14 @@ split_point_start: // At split points actual search starts from here
 
           if (futilityValue < beta)
           {
+              bestValue = std::max(bestValue, futilityValue);
+
               if (SpNode)
+              {
                   splitPoint->mutex.lock();
-
+                  if (bestValue > splitPoint->bestValue)
+                      splitPoint->bestValue = bestValue;
+              }
               continue;
           }