X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fevaluate.cpp;h=aeaae07f10720114be0986e93b91d37f6ee41200;hb=8df17204f4469977604695e4ae5d63ae47a575ff;hp=6990a71d2bbb306d945cfedebc94c659e1497475;hpb=c2902112e51b50c8ebcf263825597f437fdf56e7;p=stockfish diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 6990a71d..aeaae07f 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -171,6 +171,9 @@ namespace { // right to castle. const Value TrappedRookPenalty = Value(180); + // Penalty for bishop with pawns on the same coloured squares + const Score BishopPawnsPenalty = make_score(8, 12); + // Penalty for a bishop on a1/h1 (a8/h8 for black) which is trapped by // a friendly pawn on b2/g2 (b7/g7 for black). This can obviously only // happen in Chess960 games. @@ -582,6 +585,10 @@ Value do_evaluate(const Position& pos, Value& margin) { && !more_than_one(BetweenBB[s][pos.king_square(Them)] & pos.pieces())) score += BishopPinBonus; + // Penalty for bishop with same coloured pawns + if (Piece == BISHOP) + score -= BishopPawnsPenalty * ei.pi->pawns_on_same_color_squares(Us, s); + // Bishop and knight outposts squares if ( (Piece == BISHOP || Piece == KNIGHT) && !(pos.pieces(Them, PAWN) & attack_span_mask(Us, s)))