X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=b6085b7312c49c22389de90a459decdc5a1bb41e;hp=70c91f8ae7a877d2ffdf6efbf6395120835c2ce9;hb=bd8f463b7e93e1a0a8c8be07b0c022326f507722;hpb=4d14f97482345580b625a2fef9be2c82d7031767 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 70c91f8a..b6085b73 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -530,10 +530,17 @@ Value do_evaluate(const Position& pos, Value& margin) { if (Piece == BISHOP) score -= BishopPawns * ei.pi->pawns_on_same_color_squares(Us, s); - // Bishop and knight outposts squares - if ( (Piece == BISHOP || Piece == KNIGHT) - && !(pos.pieces(Them, PAWN) & pawn_attack_span(Us, s))) - score += evaluate_outposts(pos, ei, s); + if (Piece == BISHOP || Piece == KNIGHT) + { + // Bishop and knight outposts squares + if (!(pos.pieces(Them, PAWN) & pawn_attack_span(Us, s))) + score += evaluate_outposts(pos, ei, s); + + // Pawn in front of knight/bishop + if ( relative_rank(Us, s) < RANK_5 + && (pos.pieces(PAWN) & (s + pawn_push(Us)))) + score += make_score(16, 0); + } if ( (Piece == ROOK || Piece == QUEEN) && relative_rank(Us, s) >= RANK_5)