]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Count all weak squares in the king ring with a single popcount
[stockfish] / src / evaluate.cpp
index 8cb0d11cd324a35d138199e5a4d7d42bb81907cb..7ee3652b1b40c22d273f374e35e862c638269b4b 100644 (file)
@@ -439,8 +439,8 @@ namespace {
         // the quality of the pawn shelter (current 'score' value).
         kingDanger =        kingAttackersCount[Them] * kingAttackersWeight[Them]
                     + 102 * kingAdjacentZoneAttacksCount[Them]
-                    + 201 * popcount(kingOnlyDefended)
-                    + 143 * (popcount(undefended) + !!pos.pinned_pieces(Us))
+                    + 191 * popcount(kingOnlyDefended | undefended)
+                    + 143 * !!pos.pinned_pieces(Us)
                     - 848 * !pos.count<QUEEN>(Them)
                     -   9 * mg_value(score) / 8
                     +  40;