X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=d3ddfd510bad2e51a92ce991386bbcb135de2738;hp=489422fc96f163770aa71791f987baa6d4b0a8a4;hb=7396c08b795191d954528d687e84d7ff6dbe7a3b;hpb=f619f1d38c3d77c315b509ae2fe637926c9059fd diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 489422fc..d3ddfd51 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -703,10 +703,10 @@ namespace { // ...count safe + (behind & safe) with a single popcount int bonus = popcount((Us == WHITE ? safe << 32 : safe >> 32) | (behind & safe)); - int weight = pos.count(Us) + pos.count(Us) - + pos.count(Them) + pos.count(Them); + bonus = std::min(16, bonus); + int weight = pos.count(Us); - return make_score(bonus * weight * weight * 2 / 11, 0); + return make_score(bonus * weight * weight / 22, 0); }