X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovepick.cpp;h=589c27b3585383be0ac6823907f767b36696d36b;hp=2b20f25f002447861a6deeddbf6260af21114c2b;hb=377c406c748643d1aeec6a7ce9a45b32a7416bf3;hpb=f2e78d9f841b53b8d512ad2687ff982cf841df58 diff --git a/src/movepick.cpp b/src/movepick.cpp index 2b20f25f..589c27b3 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -72,7 +72,7 @@ namespace { /// move ordering is at the current node. MovePicker::MovePicker(const Position& p, Move ttm, Depth d, const History& h, - SearchStack* ss, Value beta) : pos(p), H(h), depth(d) { + Search::Stack* ss, Value beta) : pos(p), H(h), depth(d) { captureThreshold = 0; badCaptures = moves + MAX_MOVES; @@ -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; }