- // Are all pawns on the 'a' file?
- if (!(pawns & ~FileABB))
- {
- // Does the defending king block the pawns?
- if ( square_distance(ksq, relative_square(strongSide, SQ_A8)) <= 1
- || ( file_of(ksq) == FILE_A
- && !(in_front_bb(strongSide, rank_of(ksq)) & pawns)))
- return SCALE_FACTOR_DRAW;
- }
- // Are all pawns on the 'h' file?
- else if (!(pawns & ~FileHBB))
- {
- // Does the defending king block the pawns?
- if ( square_distance(ksq, relative_square(strongSide, SQ_H8)) <= 1
- || ( file_of(ksq) == FILE_H
- && !(in_front_bb(strongSide, rank_of(ksq)) & pawns)))
- return SCALE_FACTOR_DRAW;
- }