// in KingDanger[]. Various little "meta-bonuses" measuring the strength
// of the enemy attack are added up into an integer, which is used as an
// index to KingDanger[].
- Score KingDanger[512];
+ Score KingDanger[400];
// KingAttackWeights[PieceType] contains king attack weights by piece type
const int KingAttackWeights[PIECE_TYPE_NB] = { 0, 0, 7, 5, 4, 1 };
// ...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);
}