Consider checks by pawn drops in king danger
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 15 Dec 2018 18:08:33 +0000 (19:08 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Thu, 20 Dec 2018 15:05:34 +0000 (16:05 +0100)
crazyhouse STC
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 5743 W: 2882 L: 2699 D: 162
http://35.161.250.236:6543/tests/view/5c15435c6e23db7639060cf5

crazyhouse LTC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 4798 W: 2401 L: 2233 D: 164
http://35.161.250.236:6543/tests/view/5c1969046e23db24728955c6

src/evaluate.cpp

index c0e7b0d..7ad151d 100644 (file)
@@ -496,6 +496,15 @@ namespace {
                     unsafeChecks |= b;
                 break;
             case PAWN:
+                if (pos.captures_to_hand() && pos.count_in_hand(Them, pt))
+                {
+                    b = attacks_bb(Us, pt, ksq, pos.pieces()) & ~pos.pieces() & pos.board_bb();
+                    if (b & safe)
+                        kingDanger += OtherSafeCheck;
+                    else
+                        unsafeChecks |= b;
+                }
+                break;
             case SHOGI_PAWN:
             case KING:
                 break;