X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=57bbfe09d87f6d97a4a940a3be85930d0f9641fb;hp=c9b2d31b0d42f1e5f61b2ee63b3e8ee65c69da8d;hb=553ead429d94b6314ff14aa3eb724f47987e5a52;hpb=7bdb8c9c5c82629f50252151afd542316665c505 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index c9b2d31b..57bbfe09 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -494,16 +494,16 @@ Value do_evaluate(const Position& pos) { if (ei.attackedBy[Them][PAWN] & s) score -= ThreatenedByPawn[Pt]; - // Penalty for bishop with same coloured pawns - if (Pt == BISHOP) - score -= BishopPawns * ei.pi->pawns_on_same_color_squares(Us, s); - - // Penalty for knight when there are few enemy pawns - if (Pt == KNIGHT) - score -= KnightPawns * std::max(5 - pos.count(Them), 0); - if (Pt == BISHOP || Pt == KNIGHT) { + // Penalty for bishop with same colored pawns + if (Pt == BISHOP) + score -= BishopPawns * ei.pi->pawns_on_same_color_squares(Us, s); + + // Penalty for knight when there are few enemy pawns + if (Pt == KNIGHT) + score -= KnightPawns * std::max(5 - pos.count(Them), 0); + // Bishop and knight outposts squares if (!(pos.pieces(Them, PAWN) & pawn_attack_span(Us, s))) score += evaluate_outposts(pos, ei, s);