From: Fabian Fichter Date: Wed, 13 Jan 2021 18:22:48 +0000 (+0100) Subject: Evaluate shogi pawn promotion checks X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=2e62a4b16a4f50f7ce14f654093fe8768caa7c09;p=fairystockfish.git Evaluate shogi pawn promotion checks shogi STC LLR: -2.97 (-2.94,2.94) [0.00,10.00] Total: 11377 W: 5693 L: 5632 D: 52 http://www.variantfishtest.org:6543/tests/view/5fe9debf6e23db221d9e9705 shogi LTC LLR: 2.95 (-2.94,2.94) [0.00,10.00] Total: 17659 W: 8964 L: 8608 D: 87 http://www.variantfishtest.org:6543/tests/view/5fef28506e23db221d9e9812 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index ccfd4d7..239cf2e 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -725,6 +725,16 @@ namespace { } break; case SHOGI_PAWN: + if (pos.promoted_piece_type(pt)) + { + otherChecks = attacks_bb(Us, pos.promoted_piece_type(pt), ksq, pos.pieces()) & attackedBy[Them][pt] + & zone_bb(Them, pos.promotion_rank(), pos.max_rank()) & pos.board_bb(); + if (otherChecks & safe) + kingDanger += SafeCheck[FAIRY_PIECES][more_than_one(otherChecks & safe)]; + else + unsafeChecks |= otherChecks; + } + break; case KING: break; default: