]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Fixes a Chess960 bug when playing with more than one search thread.
[stockfish] / src / search.cpp
index 65c29bf3741a395f90ba2b703b9a01b4255c3865..71b974b677d893f3325734f0de639de984c9e2b5 100644 (file)
@@ -442,6 +442,10 @@ bool think(const Position& pos, bool infinite, bool ponder, int side_to_move,
   {
       ActiveThreads = newActiveThreads;
       init_eval(ActiveThreads);
+      // HACK: init_eval() destroys the static castleRightsMask[] array in the
+      // Position class. The below line repairs the damage.
+      Position p(pos.to_fen());
+      assert(pos.is_ok());
   }
 
   // Wake up sleeping threads