]> git.sesse.net Git - stockfish/blobdiff - src/evaluate.cpp
Refactor previous patch
[stockfish] / src / evaluate.cpp
index d533eed8c76d17172c10632c2c0cdada03a5a7a6..35764b717207e38b3871f367d4edbe5c400f8fc6 100644 (file)
@@ -706,9 +706,9 @@ namespace {
     // ...count safe + (behind & safe) with a single popcount
     int bonus = popcount((Us == WHITE ? safe << 32 : safe >> 32) | (behind & safe));
     bonus = std::min(16, bonus);
-    int weight = pos.count<ALL_PIECES>(Us);
+    int weight = pos.count<ALL_PIECES>(Us) - 2 * ei.pi->open_files();
 
-    return make_score(bonus * weight * weight / 22, 0);
+    return make_score(bonus * weight * weight / 18, 0);
   }