const Score QueenOnPawnBonus = make_score( 4, 20);
const Score RookOpenFileBonus = make_score(43, 21);
const Score RookHalfOpenFileBonus = make_score(19, 10);
- const Score BishopPawnsPenalty = make_score(8, 12);
+ const Score BishopPawnsPenalty = make_score( 8, 12);
const Score UndefendedMinorPenalty = make_score(25, 10);
- const Score TrappedRookPenalty = make_score(90, 0);
+ const Score TrappedRookPenalty = make_score(90, 0);
// 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
// Penalize rooks which are trapped inside a king. Penalize more if
// king has lost right to castle.
if ( ((file_of(ksq) < FILE_E) == (file_of(s) < file_of(ksq)))
- && rank_of(ksq) == rank_of(s)
- && relative_rank(Us, ksq) == RANK_1
+ && (rank_of(ksq) == rank_of(s) || relative_rank(Us, ksq) == RANK_1)
&& !ei.pi->half_open_on_side(Us, file_of(ksq), file_of(ksq) < FILE_E))
score -= (TrappedRookPenalty - make_score(mob * 8, 0)) * (pos.can_castle(Us) ? 1 : 2);
}