From 805085aa64416aa3a0570b3d0fc8183e1ad71205 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Fri, 30 Nov 2018 15:35:05 +0100 Subject: [PATCH] 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 --- src/evaluate.cpp | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 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; -- 1.7.0.4