diff --git a/src/bitboard.h b/src/bitboard.h index ceac2c24ed5..8154f574c6d 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -84,8 +84,6 @@ extern Bitboard PseudoAttacks[PIECE_TYPE_NB][SQUARE_NB]; extern int SquareDistance[SQUARE_NB][SQUARE_NB]; const Bitboard DarkSquares = 0xAA55AA55AA55AA55ULL; -const Bitboard TheirHalf[COLOR_NB] = { Rank5BB | Rank6BB | Rank7BB | Rank8BB, - Rank1BB | Rank2BB | Rank3BB | Rank4BB }; /// Overloads of bitwise operators between a Bitboard and a Square for testing /// whether a given bit is set in a bitboard, and for setting and clearing bits. diff --git a/src/position.h b/src/position.h index 6defeb22bd9..4e15bb136f9 100644 --- a/src/position.h +++ b/src/position.h @@ -327,7 +327,8 @@ inline bool Position::pawn_passed(Color c, Square s) const { } inline bool Position::advanced_pawn_push(Move m) const { - return pieces(PAWN) & TheirHalf[sideToMove] & from_sq(m); + return type_of(moved_piece(m)) == PAWN + && relative_rank(sideToMove, from_sq(m)) > RANK_4; } inline Key Position::key() const {