]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Include bishop protection in king Danger evaluation. #2118
[stockfish] / src / evaluate.cpp
index 566eba6d93433659afa89898dac49de293c50cbb..7e6260c8a34128fe588b3a2c492e07af526986b1 100644 (file)
@@ -467,12 +467,13 @@ namespace {
                  +  69 * kingAttacksCount[Them]
                  + 185 * popcount(kingRing[Us] & weak)
                  - 100 * bool(attackedBy[Us][KNIGHT] & attackedBy[Us][KING])
+                 -  35 * bool(attackedBy[Us][BISHOP] & attackedBy[Us][KING])
                  + 150 * popcount(pos.blockers_for_king(Us) | unsafeChecks)
                  - 873 * !pos.count<QUEEN>(Them)
                  -   6 * mg_value(score) / 8
                  +       mg_value(mobility[Them] - mobility[Us])
                  +   5 * kingFlankAttacks * kingFlankAttacks / 16
-                 -   15;
+                 -   7;
 
     // Transform the kingDanger units into a Score, and subtract it from the evaluation
     if (kingDanger > 100)