]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Fix greater than TB scores in null move pruning.
[stockfish] / src / search.cpp
index a1834ab99b303387f505cd4011ee2f1cc4a25026..1b019a08e829f466038536aa5fd35adb60e7bb7f 100644 (file)
@@ -812,11 +812,9 @@ namespace {
 
         pos.undo_null_move();
 
-        if (nullValue >= beta)
+        // Do not return unproven mate or TB scores
+        if (nullValue >= beta && nullValue < VALUE_TB_WIN_IN_MAX_PLY)
         {
-            // Do not return unproven mate or TB scores
-            nullValue = std::min(nullValue, VALUE_TB_WIN_IN_MAX_PLY-1);
-
             if (thisThread->nmpMinPly || depth < 14)
                 return nullValue;