]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Small touches to book.cpp
[stockfish] / src / search.cpp
index 36f57b424646caa60bae5be859d51bd04b441e65..eea091d4bcf33d0b9f789a493ff8200d77c9e808 100644 (file)
@@ -270,7 +270,7 @@ namespace {
     if (moveIsCheck && pos.see_sign(m) >= 0)
         result += CheckExtension[PvNode];
 
-    if (piece_type(pos.piece_on(move_from(m))) == PAWN)
+    if (type_of(pos.piece_on(move_from(m))) == PAWN)
     {
         Color c = pos.side_to_move();
         if (relative_rank(c, move_to(m)) == RANK_7)
@@ -286,7 +286,7 @@ namespace {
     }
 
     if (   captureOrPromotion
-        && piece_type(pos.piece_on(move_to(m))) != PAWN
+        && type_of(pos.piece_on(move_to(m))) != PAWN
         && (  pos.non_pawn_material(WHITE) + pos.non_pawn_material(BLACK)
             - piece_value_midgame(pos.piece_on(move_to(m))) == VALUE_ZERO)
         && !move_is_special(m))
@@ -391,7 +391,7 @@ bool think(Position& pos, const SearchLimits& limits, Move searchMoves[]) {
       if (Options["Book File"].value<string>() != book.name())
           book.open(Options["Book File"].value<string>());
 
-      Move bookMove = book.get_move(pos, Options["Best Book Move"].value<bool>());
+      Move bookMove = book.probe(pos, Options["Best Book Move"].value<bool>());
       if (bookMove != MOVE_NONE)
       {
           if (Limits.ponder)
@@ -1493,7 +1493,7 @@ split_point_start: // At split points actual search starts from here
 
     from = move_from(move);
     to = move_to(move);
-    them = opposite_color(pos.side_to_move());
+    them = flip(pos.side_to_move());
     ksq = pos.king_square(them);
     kingAtt = pos.attacks_from<KING>(ksq);
     pc = pos.piece_on(from);
@@ -1509,7 +1509,7 @@ split_point_start: // At split points actual search starts from here
         return true;
 
     // Rule 2. Queen contact check is very dangerous
-    if (   piece_type(pc) == QUEEN
+    if (   type_of(pc) == QUEEN
         && bit_is_set(kingAtt, to))
         return true;
 
@@ -1644,7 +1644,7 @@ split_point_start: // At split points actual search starts from here
     // value of the threatening piece, don't prune moves which defend it.
     if (   pos.move_is_capture(threat)
         && (   piece_value_midgame(pos.piece_on(tfrom)) >= piece_value_midgame(pos.piece_on(tto))
-            || piece_type(pos.piece_on(tfrom)) == KING)
+            || type_of(pos.piece_on(tfrom)) == KING)
         && pos.move_attacks_square(m, tto))
         return true;