Improve evaluation of checks by piece drops
authorFabian Fichter <ianfab@users.noreply.github.com>
Sun, 1 Mar 2020 19:08:43 +0000 (20:08 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sun, 1 Mar 2020 19:08:43 +0000 (20:08 +0100)
shogun
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 426 W: 243 L: 143 D: 40

pocketknight STC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 2526 W: 748 L: 648 D: 1130
http://www.variantfishtest.org:6543/tests/view/5e5b92a66e23db46beba4f20

pocketknight LTC
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 1691 W: 505 L: 415 D: 771
http://www.variantfishtest.org:6543/tests/view/5e5bb85d6e23db46beba4f2a

src/evaluate.cpp

index cf696d0..34f8bcb 100644 (file)
@@ -483,7 +483,7 @@ namespace {
     b2 = attacks_bb<BISHOP>(ksq, pos.pieces() ^ pos.pieces(Us, QUEEN));
 
     std::function <Bitboard (Color, PieceType)> get_attacks = [this](Color c, PieceType pt) {
-        return attackedBy[c][pt] | (pos.captures_to_hand() && pos.count_in_hand(c, pt) ? ~pos.pieces() : Bitboard(0));
+        return attackedBy[c][pt] | (pos.piece_drops() && pos.count_in_hand(c, pt) ? pos.drop_region(c, pt) & ~pos.pieces() : Bitboard(0));
     };
     for (PieceType pt : pos.piece_types())
     {
@@ -514,7 +514,7 @@ namespace {
                 unsafeChecks |= knightChecks;
             break;
         case PAWN:
-            if (pos.captures_to_hand() && pos.count_in_hand(Them, pt))
+            if (pos.piece_drops() && pos.count_in_hand(Them, pt))
             {
                 pawnChecks = attacks_bb(Us, pt, ksq, pos.pieces()) & ~pos.pieces() & pos.board_bb();
                 if (pawnChecks & safe)