Fix MultiPv and Skill in SMP.
[stockfish] / src / search.cpp
index 1e9c5010c97df7c56f2221b6b96081bdd49dc466..3c34f185c35eda640b5022851eccdf65631a588a 100644 (file)
@@ -327,10 +327,11 @@ void MainThread::search() {
 
   // Check if there are threads with a better score than main thread.
   Thread* bestThread = this;
-  for (Thread* th : Threads)
-      if (   th->completedDepth > bestThread->completedDepth
-          && th->rootMoves[0].score > bestThread->rootMoves[0].score)
-        bestThread = th;
+  if (Options["MultiPV"] == 1 && !Skill(Options["Skill Level"]).enabled())
+      for (Thread* th : Threads)
+          if (   th->completedDepth > bestThread->completedDepth
+              && th->rootMoves[0].score > bestThread->rootMoves[0].score)
+            bestThread = th;
 
   // Send new PV when needed.
   // FIXME: Breaks multiPV, and skill levels