From: Fabian Fichter Date: Fri, 13 Mar 2020 15:14:34 +0000 (+0100) Subject: Evaluate virtual piece drop checks in bughouse X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=04b743719b0025da26e2fca9741541aaa552f150;p=fairystockfish.git Evaluate virtual piece drop checks in bughouse bughouse Total: 1000 W: 531 L: 459 D: 10 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index b871253..ff0b25b 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -514,7 +514,7 @@ namespace { unsafeChecks |= knightChecks; break; case PAWN: - if (pos.piece_drops() && (pos.count_in_hand(Them, pt) || pos.two_boards())) + 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) @@ -535,6 +535,14 @@ namespace { } } + // Virtual piece drops + if (pos.two_boards() && pos.piece_drops()) + { + for (PieceType pt : pos.piece_types()) + if (!pos.count_in_hand(Them, pt) && (attacks_bb(Us, pt, ksq, pos.pieces()) & safe & pos.drop_region(Them, pt) & ~pos.pieces())) + kingDanger += OtherSafeCheck * 500 / (500 + PieceValue[MG][pt]); + } + if (pos.check_counting()) kingDanger += kingDanger * 7 / (3 + pos.checks_remaining(Them));