From 651450023619ddea590f301f040286151004df66 Mon Sep 17 00:00:00 2001 From: mstembera Date: Sun, 3 Feb 2019 05:16:34 -0800 Subject: [PATCH] Less king danger if we have a knight near by to defend it. (#1987) bench: 3653942 --- src/evaluate.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 9bdb2b99..617e33fb 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -482,12 +482,13 @@ namespace { kingDanger += kingAttackersCount[Them] * kingAttackersWeight[Them] + 69 * kingAttacksCount[Them] + 185 * popcount(kingRing[Us] & weak) + - 100 * bool(attackedBy[Us][KNIGHT] & attackedBy[Us][KING]) + 150 * popcount(pos.blockers_for_king(Us) | unsafeChecks) + 5 * tropism * tropism / 16 - 873 * !pos.count(Them) - 6 * mg_value(score) / 8 + mg_value(mobility[Them] - mobility[Us]) - - 30; + - 25; // Transform the kingDanger units into a Score, and subtract it from the evaluation if (kingDanger > 0) -- 2.39.2