X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Ftt.cpp;h=b7d47e7498951320a861dd60c66877a0a3ce710e;hp=fc0bdfb47c1c96f1738c8403795640fbf13056f8;hb=62c68c2d2174ee5158cf3282c7429b15483f3d51;hpb=47ee6d9fa4091aa05f6fedb62a2bb652b0422f08 diff --git a/src/tt.cpp b/src/tt.cpp index fc0bdfb4..b7d47e74 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -185,16 +185,17 @@ void TranspositionTable::insert_pv(const Position& pos, Move pv[]) { /// will often get single-move PVs when the search stops while failing high, /// and a single-move PV means that we don't have a ponder move. -void TranspositionTable::extract_pv(const Position& pos, Move pv[], const int PLY_MAX) { +void TranspositionTable::extract_pv(const Position& pos, Move bestMove, Move pv[], const int PLY_MAX) { const TTEntry* tte; StateInfo st; Position p(pos, pos.thread()); int ply = 0; - // Update position to the end of current PV - while (pv[ply] != MOVE_NONE) - p.do_move(pv[ply++], st); + assert(bestMove != MOVE_NONE); + + pv[ply] = bestMove; + p.do_move(pv[ply++], st); // Try to add moves from TT while possible while ( (tte = retrieve(p.get_key())) != NULL