]> git.sesse.net Git - stockfish/blobdiff - src/book.cpp
Allow to pass a 'seed' to RKISS
[stockfish] / src / book.cpp
index b7237054723a7ab86469309625e21c861e63f2dc..d75d63f97b9e87eaf18ea4f84c85a8d0da007bcd 100644 (file)
@@ -348,11 +348,7 @@ namespace {
 
 } // namespace
 
-PolyglotBook::PolyglotBook() {
-
-  for (int i = Time::now() % 10000; i > 0; i--)
-      RKiss.rand<unsigned>(); // Make random number generation less deterministic
-}
+PolyglotBook::PolyglotBook() : RKiss(Time::now() % 10000) {}
 
 PolyglotBook::~PolyglotBook() { if (is_open()) close(); }
 
@@ -440,7 +436,7 @@ Move PolyglotBook::probe(const Position& pos, const string& fName, bool pickBest
 
   // Add 'special move' flags and verify it is legal
   for (MoveList<LEGAL> ml(pos); !ml.end(); ++ml)
-      if (move == (ml.move() & 0x3FFF))
+      if (move == (ml.move() ^ type_of(ml.move())))
           return ml.move();
 
   return MOVE_NONE;