From: Fabian Fichter Date: Fri, 30 Nov 2018 14:35:05 +0000 (+0100) Subject: Always evaluate king danger for drop variants X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=805085aa64416aa3a0570b3d0fc8183e1ad71205;p=fairystockfish.git Always evaluate king danger for drop variants shogi LLR: 2.98 (-2.94,2.94) [0.00,10.00] Total: 848 W: 464 L: 352 D: 32 minishogi LLR: 3.03 (-2.94,2.94) [-10.00,5.00] Total: 990 W: 485 L: 427 D: 78 crazyhouse STC LLR: 2.98 (-2.94,2.94) [-10.00,5.00] Total: 1223 W: 629 L: 570 D: 24 http://35.161.250.236:6543/tests/view/5c014b236e23db7639060cc0 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 1b69905..013e1ce 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -273,7 +273,7 @@ namespace { attackedBy2[Us] = attackedBy[Us][KING] & attackedBy[Us][PAWN]; // Init our king safety tables only if we are going to use them - if (pos.count(Us) && pos.non_pawn_material(Them) >= RookValueMg + KnightValueMg) + if ((pos.count(Us) && pos.non_pawn_material(Them) >= RookValueMg + KnightValueMg) || pos.captures_to_hand()) { kingRing[Us] = attackedBy[Us][KING]; if (relative_rank(Us, pos.square(Us), pos.max_rank()) == RANK_1) @@ -454,7 +454,7 @@ namespace { Score score = pe->king_safety(pos, ksq); // Main king safety evaluation - if (kingAttackersCount[Them] > 1 - pos.count(Them)) + if ((kingAttackersCount[Them] > 1 - pos.count(Them)) || pos.captures_to_hand()) { int kingDanger = 0; unsafeChecks = 0;