]> git.sesse.net Git - stockfish/blobdiff - src/movepick.cpp
Set captureThreshold according to static evaluation
[stockfish] / src / movepick.cpp
index 0b3b6fd6b0e4d1e88d9052036ce58e07f886d279..589c27b3585383be0ac6823907f767b36696d36b 100644 (file)
@@ -88,11 +88,14 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h,
       killers[0].move = ss->killers[0];
       killers[1].move = ss->killers[1];
 
-      // Consider sligtly negative captures as good if at low
-      // depth and far from beta.
+      // Consider sligtly negative captures as good if at low depth and far from beta
       if (ss && ss->eval < beta - PawnValueMidgame && d < 3 * ONE_PLY)
           captureThreshold = -PawnValueMidgame;
 
+      // Consider negative captures as good if still enough to reach beta
+      else if (ss && ss->eval > beta)
+          captureThreshold = beta - ss->eval;
+
       phasePtr = MainSearchTable;
   }