Less king danger if we have a knight near by to defend it. (#1987)
authormstembera <m_stembera@yahoo.com>
Sun, 3 Feb 2019 13:16:34 +0000 (05:16 -0800)
committerMarco Costalba <mcostalba@users.noreply.github.com>
Sun, 3 Feb 2019 13:16:34 +0000 (14:16 +0100)
bench: 3653942

src/evaluate.cpp

index 9bdb2b99bcb930e0a3cb955b8b99ac07a9d67e6b..617e33fbe93a2b337b4fd42471a60a619e5b2f48 100644 (file)
@@ -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<QUEEN>(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)