From b768da6a52cae2bde7684d40b77b2b4c719530d8 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Fri, 13 Jan 2023 20:27:55 +0100 Subject: [PATCH] Consider configured pawn mobility region Closes #498. --- src/movegen.cpp | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/movegen.cpp b/src/movegen.cpp index b8e1d1a..fe90154 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -114,9 +114,9 @@ namespace { Bitboard TRank3BB = forward_ranks_bb(Us, relative_rank(Us, pos.double_step_rank_min(), pos.max_rank())) & ~shift(forward_ranks_bb(Us, relative_rank(Us, pos.double_step_rank_max(), pos.max_rank()))); - const Bitboard emptySquares = Type == QUIETS || Type == QUIET_CHECKS ? target : ~pos.pieces() & pos.board_bb(); - const Bitboard enemies = Type == EVASIONS ? (pos.checkers() & pos.non_sliding_riders() ? pos.pieces(Them) : pos.checkers()) - : Type == CAPTURES ? target : pos.pieces(Them); + const Bitboard emptySquares = (Type == QUIETS || Type == QUIET_CHECKS ? target : ~pos.pieces()) & pos.board_bb(Us, PAWN); + const Bitboard enemies = (Type == EVASIONS ? (pos.checkers() & pos.non_sliding_riders() ? pos.pieces(Them) : pos.checkers()) + : Type == CAPTURES ? target : pos.pieces(Them)) & pos.board_bb(Us, PAWN); Bitboard pawnsOn7 = pos.pieces(Us, PAWN) & TRank7BB; Bitboard pawnsNotOn7 = pos.pieces(Us, PAWN) & (pos.mandatory_pawn_promotion() ? ~TRank7BB : AllSquares); -- 1.7.0.4