]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Allow inCheck pruning
[stockfish] / src / search.cpp
index 1d8139c41d8c764e974616ed5b54c8ee6cb3df34..64cdb325ebce53c3a785747767cf76109b5daa31 100644 (file)
@@ -919,7 +919,6 @@ moves_loop: // When in check search starts from here
 
       // Step 13. Pruning at shallow depth
       if (  !rootNode
-          && !inCheck
           &&  bestValue > VALUE_MATED_IN_MAX_PLY)
       {
           if (   !captureOrPromotion
@@ -1121,6 +1120,9 @@ moves_loop: // When in check search starts from here
     // All legal moves have been searched and if there are no legal moves, it
     // must be a mate or a stalemate. If we are in a singular extension search then
     // return a fail low score.
+
+    assert(moveCount || !inCheck || excludedMove || !MoveList<LEGAL>(pos).size());
+
     if (!moveCount)
         bestValue = excludedMove ? alpha
                    :     inCheck ? mated_in(ss->ply) : DrawValue[pos.side_to_move()];