File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -425,20 +425,18 @@ Value Worker::search(
425425
426426 MoveGen movegen{pos};
427427
428- if (!movegen.is_legal (tt_data->move )) {
429- return tt_data->score ;
430- }
428+ if (movegen.is_legal (tt_data->move )) {
429+ Position pos_after = pos.move (tt_data->move , m_td.push_psqt_state ());
430+ auto tt_data_after = m_searcher.tt .probe (pos_after, ply);
431+ m_td.pop_psqt_state ();
431432
432- Position pos_after = pos.move (tt_data->move , m_td.push_psqt_state ());
433- auto tt_data_after = m_searcher.tt .probe (pos_after, ply);
434- m_td.pop_psqt_state ();
435-
436- if (!tt_data_after) {
437- return tt_data->score ;
438- }
433+ if (!tt_data_after) {
434+ return tt_data->score ;
435+ }
439436
440- if ((tt_data->score >= beta) == (tt_data_after->score <= -beta)) {
441- return tt_data->score ;
437+ if ((tt_data->score >= beta) == (tt_data_after->score <= -beta)) {
438+ return tt_data->score ;
439+ }
442440 }
443441 }
444442
You can’t perform that action at this time.
0 commit comments