diff --git a/src/search.cpp b/src/search.cpp index 5e4b4ca2b..36bfbdd85 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -752,6 +752,8 @@ Value Search::Worker::search( ss->statScore = 0; (ss + 2)->cutoffCnt = 0; + const auto correctionValue = correction_value(*this, pos, ss); + // Step 4. Transposition table lookup excludedMove = ss->excludedMove; posKey = pos.key(); @@ -764,8 +766,8 @@ Value Search::Worker::search( ttCapture = ttData.move && pos.capture_stage(ttData.move); // Step 5. Static evaluation of the position - Value unadjustedStaticEval = VALUE_NONE; - const auto correctionValue = correction_value(*this, pos, ss); + Value unadjustedStaticEval = VALUE_NONE; + // Skip early pruning when in check if (ss->inCheck) ss->staticEval = eval = (ss - 2)->staticEval;