- // Analyse safe rook contact checks:
- if (RookContactCheckBonus)
- {
- b = undefended & ei.attacked_by(them, ROOK) & ~p.pieces_of_color(them);
- if (b)
- {
- Bitboard attackedByOthers =
- ei.attacked_by(them, PAWN) | ei.attacked_by(them, KNIGHT)
- | ei.attacked_by(them, BISHOP) | ei.attacked_by(them, QUEEN);
-
- b &= attackedByOthers;
- if (b)
- {
- int count = count_1s_max_15(b);
- attackUnits += (RookContactCheckBonus * count * (sente? 2 : 1));
- }
- }
- }
- // Analyse safe distance checks: