From 2e62a4b16a4f50f7ce14f654093fe8768caa7c09 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Wed, 13 Jan 2021 19:22:48 +0100 Subject: [PATCH] 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 --- src/evaluate.cpp | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) 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: -- 1.7.0.4