- if (i < MultiPV)
- {
- // Aspiration window is disabled in multi-pv case
- if (MultiPV > 1)
- alpha = -VALUE_INFINITE;
-
- value = -search_pv(pos, ss, -beta, -alpha, newDepth, 1, 0);
- // If the value has dropped a lot compared to the last iteration,
- // set the boolean variable Problem to true. This variable is used
- // for time managment: When Problem is true, we try to complete the
- // current iteration before playing a move.
- Problem = (Iteration >= 2 && value <= IterationInfo[Iteration-1].value - ProblemMargin);
-
- if (Problem && StopOnPonderhit)
- StopOnPonderhit = false;
- }
- else
- {
- if ( newDepth >= 3*OnePly
- && i >= MultiPV + LMRPVMoves
- && !dangerous
- && !captureOrPromotion
- && !move_is_castle(move))
- {
- ss[0].reduction = OnePly;
- value = -search(pos, ss, -alpha, newDepth-OnePly, 1, true, 0);
- } else
- value = alpha + 1; // Just to trigger next condition