- // Pawn moves. Because a blocking evasion can never be a capture, we
- // only generate pawn pushes.
- if (us == WHITE)
- mlist = generate_pawn_blocking_evasions<WHITE>(pos, not_pinned, blockSquares, mlist);
- else
- mlist = generate_pawn_blocking_evasions<BLACK>(pos, not_pinned, blockSquares, mlist);
-
- // Pieces moves
- b1 = pos.knights(us) & not_pinned;
- if (b1)
- mlist = generate_piece_blocking_evasions<KNIGHT>(pos, b1, blockSquares, mlist);
-
- b1 = pos.bishops(us) & not_pinned;
- if (b1)
- mlist = generate_piece_blocking_evasions<BISHOP>(pos, b1, blockSquares, mlist);
-
- b1 = pos.rooks(us) & not_pinned;
- if (b1)
- mlist = generate_piece_blocking_evasions<ROOK>(pos, b1, blockSquares, mlist);
-
- b1 = pos.queens(us) & not_pinned;
- if (b1)
- mlist = generate_piece_blocking_evasions<QUEEN>(pos, b1, blockSquares, mlist);
- }
+ if (blockSquares != EmptyBoardBB)
+ {
+ mlist = generate_piece_moves<PAWN>(pos, mlist, us, blockSquares, pinned);
+ mlist = generate_piece_moves<KNIGHT>(pos, mlist, us, blockSquares, pinned);
+ mlist = generate_piece_moves<BISHOP>(pos, mlist, us, blockSquares, pinned);
+ mlist = generate_piece_moves<ROOK>(pos, mlist, us, blockSquares, pinned);
+ mlist = generate_piece_moves<QUEEN>(pos, mlist, us, blockSquares, pinned);
+ }
+ }