File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -49,23 +49,31 @@ namespace engine
4949 session.seldepth = std::max (session.seldepth , ply);
5050 uint64_t hash = board.hash ();
5151 Move preferred = Move::none ();
52- if (TTEntry * entry = search::tt. lookup (hash) )
52+ if (entry-> getDepth () >= depth )
5353 {
54- preferred = Move (entry->getMove ());
55- if (entry->getDepth () >= depth)
56- {
5754 Value ttScore = entry->getScore ();
5855 TTFlag flag = entry->getFlag ();
59-
56+
6057 if (flag == TTFlag::EXACT)
58+ {
59+ session.pv [ply][0 ] = Move (entry->getMove ());
60+ session.pv [ply][1 ] = Move::none ();
6161 return ttScore;
62-
62+ }
63+
6364 if (flag == TTFlag::LOWERBOUND && ttScore >= beta)
65+ {
66+ session.pv [ply][0 ] = Move (entry->getMove ());
67+ session.pv [ply][1 ] = Move::none ();
6468 return ttScore;
65-
69+ }
70+
6671 if (flag == TTFlag::UPPERBOUND && ttScore <= alpha)
72+ {
73+ session.pv [ply][0 ] = Move (entry->getMove ());
74+ session.pv [ply][1 ] = Move::none ();
6775 return ttScore;
68- }
76+ }
6977 }
7078 if (depth == 0 )
7179 {
You can’t perform that action at this time.
0 commit comments