]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Fix KXK endgame
[stockfish] / src / search.cpp
index d4cac16dd55bf4eed972cf2b44367c3a5209eca7..dbc9f0c6d9610499fdc2c389d1b467647bd1039c 100644 (file)
@@ -940,7 +940,7 @@ moves_loop: // When in check and at SpNode search starts from here
       // value of the search cannot be trusted, and we return immediately without
       // updating best move, PV and TT.
       if (Signals.stop || thisThread->cutoff_occurred())
-          return VALUE_DRAW;
+          return VALUE_ZERO;
 
       if (RootNode)
       {
@@ -997,6 +997,10 @@ moves_loop: // When in check and at SpNode search starts from here
 
           thisThread->split<FakeSplit>(pos, ss, alpha, beta, &bestValue, &bestMove,
                                        depth, moveCount, &mp, NT, cutNode);
+
+          if (Signals.stop || thisThread->cutoff_occurred())
+              return VALUE_ZERO;
+
           if (bestValue >= beta)
               break;
       }