((1ULL << SQ_A8) | (1ULL << SQ_H8))
};
- // The SpaceMask[color] contains area of the board which is consdered by
- // the space evaluation. In the middle game, each side is given a bonus
+ // The SpaceMask[color] contains the area of the board which is consdered
+ // by the space evaluation. In the middle game, each side is given a bonus
// based on how many squares inside this area are safe and available for
// friendly minor pieces.
const Bitboard SpaceMask[2] = {
ei.kingZone[BLACK] = ei.attackedBy[WHITE][KING] | (ei.attackedBy[WHITE][KING] << 8);
// Initialize pawn attack bitboards for both sides
- ei.attackedBy[WHITE][PAWN] = ((pos.pieces(PAWN, WHITE) << 9) & ~FileABB) | ((pos.pieces(PAWN, WHITE) << 7) & ~FileHBB);
- ei.attackedBy[BLACK][PAWN] = ((pos.pieces(PAWN, BLACK) >> 7) & ~FileABB) | ((pos.pieces(PAWN, BLACK) >> 9) & ~FileHBB);
+ ei.attackedBy[WHITE][PAWN] = ei.pi->pawn_attacks(WHITE);
+ ei.attackedBy[BLACK][PAWN] = ei.pi->pawn_attacks(BLACK);
Bitboard b1 = ei.attackedBy[WHITE][PAWN] & ei.attackedBy[BLACK][KING];
Bitboard b2 = ei.attackedBy[BLACK][PAWN] & ei.attackedBy[WHITE][KING];
if (b1)