X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=3838375fa5517029f5c9d6e1b38018d83a490249;hp=3ad5423d9d41a7f4600dc97cce32bed306514b2c;hb=39f2eda2851e5f468de6edc3313801c25a8b716a;hpb=f1d982e2c07372627394b83cf24f48e77a34145b diff --git a/src/search.cpp b/src/search.cpp index 3ad5423d..3838375f 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1309,6 +1309,7 @@ namespace { else if ( !value_is_mate(beta) && depth < RazorDepth && approximateEval < beta - RazorApprMargins[int(depth) - 2] + && ss[ply - 1].currentMove != MOVE_NULL && ttMove == MOVE_NONE && !pos.has_pawn_on_7th(pos.side_to_move())) { @@ -1921,7 +1922,7 @@ namespace { // Constructor RootMove::RootMove() { - nodes = cumulativeNodes = 0ULL; + nodes = cumulativeNodes = ourBeta = theirBeta = 0ULL; } // RootMove::operator<() is the comparison function used when @@ -1957,22 +1958,20 @@ namespace { for (int k = 0; !includeMove && searchMoves[k] != MOVE_NONE; k++) includeMove = (searchMoves[k] == mlist[i].move); - if (includeMove) - { - // Find a quick score for the move - StateInfo st; - SearchStack ss[PLY_MAX_PLUS_2]; - - moves[count].move = mlist[i].move; - moves[count].nodes = 0ULL; - pos.do_move(moves[count].move, st); - moves[count].score = -qsearch(pos, ss, -VALUE_INFINITE, VALUE_INFINITE, - Depth(0), 1, 0); - pos.undo_move(moves[count].move); - moves[count].pv[0] = moves[i].move; - moves[count].pv[1] = MOVE_NONE; // FIXME - count++; - } + if (!includeMove) + continue; + + // Find a quick score for the move + StateInfo st; + SearchStack ss[PLY_MAX_PLUS_2]; + + moves[count].move = mlist[i].move; + pos.do_move(moves[count].move, st); + moves[count].score = -qsearch(pos, ss, -VALUE_INFINITE, VALUE_INFINITE, Depth(0), 1, 0); + pos.undo_move(moves[count].move); + moves[count].pv[0] = moves[count].move; + moves[count].pv[1] = MOVE_NONE; // FIXME + count++; } sort(); }