]> git.sesse.net Git - stockfish/blobdiff - src/uci.cpp
Added some FIXME to track needed tests
[stockfish] / src / uci.cpp
index f7ba2067ee509dbb3c5e735b49fe731712152faf..51eb15b671f380d0542880c9c4e200f8a41adf87 100644 (file)
@@ -54,7 +54,7 @@ namespace {
   // The root position. This is set up when the user (or in practice, the GUI)
   // sends the "position" UCI command. The root position is sent to the think()
   // function when the program receives the "go" command.
-  Position RootPosition;
+  Position RootPosition(StartPosition);
 
   // Local functions
   bool handle_command(const string& command);
@@ -210,7 +210,7 @@ namespace {
             }
             // Our StateInfo st is about going out of scope so copy
             // its content inside RootPosition before they disappear.
-            RootPosition.saveState();
+            RootPosition.detach();
         }
     }
   }
@@ -292,18 +292,13 @@ namespace {
         else if (token == "searchmoves")
         {
             int numOfMoves = 0;
-            while (!uip.eof())
-            {
-                uip >> token;
+            while (uip >> token)
                 searchMoves[numOfMoves++] = move_from_string(RootPosition, token);
-            }
+
             searchMoves[numOfMoves] = MOVE_NONE;
         }
     }
 
-    if (moveTime)
-        infinite = true;  // HACK
-
     assert(RootPosition.is_ok());
 
     return think(RootPosition, infinite, ponder, RootPosition.side_to_move(),
@@ -314,7 +309,7 @@ namespace {
 
     string token;
     int depth, tm, n;
-    Position pos = RootPosition;
+    Position pos(RootPosition);
 
     if (!(uip >> depth))
         return;