X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftt.cpp;h=f3af6432a090149ca3905839abd879b0bf33f9a7;hb=5c3ebd1fbfc8cb623dd49aabd03c33a7fcbaf127;hp=b7d47e7498951320a861dd60c66877a0a3ce710e;hpb=62c68c2d2174ee5158cf3282c7429b15483f3d51;p=stockfish diff --git a/src/tt.cpp b/src/tt.cpp index b7d47e74..f3af6432 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -197,9 +197,11 @@ void TranspositionTable::extract_pv(const Position& pos, Move bestMove, Move pv[ pv[ply] = bestMove; p.do_move(pv[ply++], st); - // Try to add moves from TT while possible + // Extract moves from TT when possible. We try hard to always + // get a ponder move, that's the reason of ply < 2 conditions. while ( (tte = retrieve(p.get_key())) != NULL && tte->move() != MOVE_NONE + && (tte->type() == VALUE_TYPE_EXACT || ply < 2) && move_is_legal(p, tte->move()) && (!p.is_draw() || ply < 2) && ply < PLY_MAX)