- // if we have a fail high/low and we are deep in the search.
- if ((value > alpha && value < beta) || current_search_time() > 2000)
- for (int i = 0; i < Min(UCIMultiPV, MultiPVIteration + 1); i++)
+ // if we have a fail high/low and we are deep in the search. Note
+ // that UCI protol requires to send all the PV lines also if are
+ // still to be searched and so refer to the previous search's score.
+ if ((value > alpha && value < beta) || current_search_time() > 5000)
+ for (int i = 0; i < Min(UCIMultiPV, (int)Rml.size()); i++)
+ {
+ bool updated = (i <= MultiPVIteration);
+
+ if (depth == 1 && !updated)
+ continue;
+
+ Depth d = (updated ? depth : depth - 1) * ONE_PLY;
+ Value s = (updated ? Rml[i].score : Rml[i].prevScore);
+