- // Move the piece and scan for X-ray attacks behind it
- occ = occupied_squares();
- do_move_bb(&occ, make_move_bb(f, t));
- xray = ( (rook_attacks_bb(s, occ) & pieces(ROOK, QUEEN))
- |(bishop_attacks_bb(s, occ) & pieces(BISHOP, QUEEN)))
- & pieces(color_of(piece_on(f)));
+ // Scan for possible X-ray attackers behind the moved piece
+ xray = (rook_attacks_bb(s, occ) & pieces(ROOK, QUEEN, color_of(piece)))
+ |(bishop_attacks_bb(s, occ) & pieces(BISHOP, QUEEN, color_of(piece)));