]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Partial revert of "Assorted trivial cleanups 5/2019".
[stockfish] / src / search.cpp
index 50bce13c309370fa7859073be858121aa2948ff5..047a08925a35bbd2650f1cb40b43d75cdbe377f6 100644 (file)
@@ -980,7 +980,7 @@ moves_loop: // When in check, search starts from here
               if (!pos.see_ge(move, Value(-29 * lmrDepth * lmrDepth)))
                   continue;
           }
-          else if ((!givesCheck || !(pos.blockers_for_king(~us) & from_sq(move)))
+          else if ((!givesCheck || !extension)
                   && !pos.see_ge(move, -PawnValueEg * (depth / ONE_PLY))) // (~20 Elo)
                   continue;
       }
@@ -1713,4 +1713,10 @@ void Tablebases::rank_root_moves(Position& pos, Search::RootMoves& rootMoves) {
         if (dtz_available || rootMoves[0].tbScore <= VALUE_DRAW)
             Cardinality = 0;
     }
+    else
+    {
+        // Clean up if root_probe() and root_probe_wdl() have failed
+        for (auto& m : rootMoves)
+            m.tbRank = 0;
+    }
 }