// ThreatenedByPawn[PieceType] contains a penalty according to which piece
// type is attacked by an enemy pawn.
const Score ThreatenedByPawn[] = {
- S(0, 0), S(0, 0), S(56, 70), S(56, 70), S(76, 99), S(86, 118)
+ S(0, 0), S(0, 0), S(80, 119), S(80, 119), S(117, 199), S(127, 218)
};
// Hanging contains a bonus for each enemy hanging piece
}
- // evaluate_outposts() evaluates bishop and knight outpost squares
+ // evaluate_outpost() evaluates bishop and knight outpost squares
template<PieceType Pt, Color Us>
- Score evaluate_outposts(const Position& pos, EvalInfo& ei, Square s) {
+ Score evaluate_outpost(const Position& pos, const EvalInfo& ei, Square s) {
const Color Them = (Us == WHITE ? BLACK : WHITE);
if (Pt == BISHOP)
score -= BishopPawns * ei.pi->pawns_on_same_color_squares(Us, s);
- // Bishop and knight outposts squares
+ // Bishop and knight outpost square
if (!(pos.pieces(Them, PAWN) & pawn_attack_span(Us, s)))
- score += evaluate_outposts<Pt, Us>(pos, ei, s);
+ score += evaluate_outpost<Pt, Us>(pos, ei, s);
// Bishop or knight behind a pawn
if ( relative_rank(Us, s) < RANK_5
// Add a bonus according if the attacking pieces are minor or major
if (weakEnemies)
{
- b = weakEnemies & (ei.attackedBy[Us][PAWN] | ei.attackedBy[Us][KNIGHT] | ei.attackedBy[Us][BISHOP]);
+ b = weakEnemies & (ei.attackedBy[Us][KNIGHT] | ei.attackedBy[Us][BISHOP]);
if (b)
score += Threat[0][type_of(pos.piece_on(lsb(b)))];