- // Bishop and knight outposts squares
- if ( (Piece == BISHOP || Piece == KNIGHT)
- && !(pos.pieces(Them, PAWN) & pawn_attack_span(Us, s)))
- score += evaluate_outposts<Piece, Us>(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<Piece, Us>(pos, ei, s);
+
+ // Bishop or knight behind a pawn
+ if ( relative_rank(Us, s) < RANK_5
+ && (pos.pieces(PAWN) & (s + pawn_push(Us))))
+ score += MinorBehindPawn;
+ }