]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Fix time_to_msec() precision
[stockfish] / src / search.cpp
index f71b54bc7d0fa6e22dc539b3b25f48d53c2ac666..9386e453ca8e9d5ffaf7ef44bfd3f25bd3a7cd7d 100644 (file)
@@ -48,6 +48,7 @@ namespace Search {
 using std::string;
 using std::cout;
 using std::endl;
+using Eval::evaluate;
 using namespace Search;
 
 namespace {
@@ -251,6 +252,7 @@ void Search::think() {
 
   Position& pos = RootPosition;
   Chess960 = pos.is_chess960();
+  Eval::RootColor = pos.side_to_move();
   SearchTime.restart();
   TimeMgr.init(Limits, pos.startpos_ply_counter());
   TT.new_search();
@@ -276,17 +278,6 @@ void Search::think() {
       }
   }
 
-  // Read UCI options: GUI could change UCI parameters during the game
-  read_evaluation_uci_options(pos.side_to_move());
-  Threads.read_uci_options();
-
-  TT.set_size(Options["Hash"]);
-  if (Options["Clear Hash"])
-  {
-      Options["Clear Hash"] = false;
-      TT.clear();
-  }
-
   UCIMultiPV = Options["MultiPV"];
   SkillLevel = Options["Skill Level"];
 
@@ -1351,7 +1342,7 @@ split_point_start: // At split points actual search starts from here
     // Rule 1. Checks which give opponent's king at most one escape square are dangerous
     b = kingAtt & ~pos.pieces(them) & ~newAtt & ~(1ULL << to);
 
-    if (!(b && (b & (b - 1))))
+    if (single_bit(b)) // Catches also !b
         return true;
 
     // Rule 2. Queen contact check is very dangerous