]> git.sesse.net Git - stockfish/commitdiff
Fix: Honour UCI "quit" command while still in the book
authorMarco Costalba <mcostalba@gmail.com>
Sat, 1 Jan 2011 12:54:44 +0000 (13:54 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 1 Jan 2011 15:07:28 +0000 (16:07 +0100)
We were not quitting the engine after a "quit" command
while still in the book and pondering.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 93f20800ca982d007610ad306030dff103e130dd..6ec051987d98663a775252e74f77e52f52f8575e 100644 (file)
@@ -424,7 +424,7 @@ bool think(Position& pos, bool infinite, bool ponder, int time[], int increment[
               wait_for_stop_or_ponderhit();
 
           cout << "bestmove " << bookMove << endl;
-          return true;
+          return !QuitRequest;
       }
   }
 
@@ -2072,7 +2072,7 @@ split_point_start: // At split points actual search starts from here
   // the UCI protocol: When pondering, the engine is not allowed to give a
   // "bestmove" before the GUI sends it a "stop" or "ponderhit" command.
   // We simply wait here until one of these commands is sent, and return,
-  // after which the bestmove and pondermove will be printed (in id_loop()).
+  // after which the bestmove and pondermove will be printed.
 
   void wait_for_stop_or_ponderhit() {