- std::swap(RootMoves[0], *find(RootMoves.begin(), RootMoves.end(), bm));
- goto finalize;
+ Move bookMove = book.probe(pos, Options["Book File"], Options["Best Book Move"]);
+
+ if (bookMove && count(RootMoves.begin(), RootMoves.end(), bookMove))
+ {
+ std::swap(RootMoves[0], *find(RootMoves.begin(), RootMoves.end(), bookMove));
+ goto finalize;
+ }