Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/movegen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,13 @@ namespace {
Bitboard quiets = pos.moves_from(Us, Pt, from);
Bitboard b = ( (attacks & pos.pieces())
| (quiets & ~pos.pieces()));
Bitboard b1 = b & target;
Bitboard epSquares = (pos.variant()->enPassantTypes[Us] & Pt) ? (attacks & pos.ep_squares() & ~pos.pieces()) : Bitboard(0);
Bitboard b1 = b & target & ~epSquares;
Bitboard promotion_zone = pos.promotion_zone(Us);
PieceType promPt = pos.promoted_piece_type(Pt);
Bitboard b2 = promPt && (!pos.promotion_limit(promPt) || pos.promotion_limit(promPt) > pos.count(Us, promPt)) ? b1 : Bitboard(0);
Bitboard b3 = pos.piece_demotion() && pos.is_promoted(from) ? b1 : Bitboard(0);
Bitboard pawnPromotions = (pos.promotion_pawn_types(Us) & Pt) ? (b & (Type == EVASIONS ? target : ~pos.pieces(Us)) & promotion_zone) : Bitboard(0);
Bitboard epSquares = (pos.en_passant_types(Us) & Pt) ? (attacks & ~quiets & pos.ep_squares() & ~pos.pieces()) : Bitboard(0);

// target squares considering pawn promotions
if (pawnPromotions && pos.mandatory_pawn_promotion())
Expand Down