- // Pieces moves
- mlist = generate_piece_blocking_evasions<PAWN>(pos, mlist, us, not_pinned, blockSquares);
- mlist = generate_piece_blocking_evasions<KNIGHT>(pos, mlist, us, not_pinned, blockSquares);
- mlist = generate_piece_blocking_evasions<BISHOP>(pos, mlist, us, not_pinned, blockSquares);
- mlist = generate_piece_blocking_evasions<ROOK>(pos, mlist, us, not_pinned, blockSquares);
- mlist = generate_piece_blocking_evasions<QUEEN>(pos, mlist, us, not_pinned, blockSquares);
- }
+ 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);
+ }
+ }