X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=8e2ecf6019b812eb5872e2f7db27d36d65ea2528;hp=3822e3bc5f225ee276724c9e3347b4e5fb772f19;hb=2c955f25de9d4c263b6e6d37fef06b378eec49a0;hpb=a188a047ab79a742e55f157f29e30299baafa7d0 diff --git a/src/position.h b/src/position.h index 3822e3bc..8e2ecf60 100644 --- a/src/position.h +++ b/src/position.h @@ -529,12 +529,12 @@ inline Square Position::initial_qr_square(Color c) const { } inline Bitboard Position::pawn_attacks(Color c, Square s) const { - return StepAttackBB[pawn_of_color(c)][s]; + return StepAttackBB[piece_of_color_and_type(c, PAWN)][s]; } template<> inline Bitboard Position::piece_attacks(Square s) const { - return StepAttackBB[pawn_of_color(opposite_color(sideToMove))][s]; + return StepAttackBB[piece_of_color_and_type(opposite_color(sideToMove), PAWN)][s]; } template<> @@ -675,28 +675,28 @@ inline Phase Position::game_phase() const { inline bool Position::move_is_deep_pawn_push(Move m) const { Color c = side_to_move(); - return piece_on(move_from(m)) == pawn_of_color(c) + return piece_on(move_from(m)) == piece_of_color_and_type(c, PAWN) && relative_rank(c, move_to(m)) > RANK_4; } inline bool Position::move_is_pawn_push_to_7th(Move m) const { Color c = side_to_move(); - return piece_on(move_from(m)) == pawn_of_color(c) + return piece_on(move_from(m)) == piece_of_color_and_type(c, PAWN) && relative_rank(c, move_to(m)) == RANK_7; } inline bool Position::move_is_passed_pawn_push(Move m) const { Color c = side_to_move(); - return piece_on(move_from(m)) == pawn_of_color(c) + return piece_on(move_from(m)) == piece_of_color_and_type(c, PAWN) && pawn_is_passed(c, move_to(m)); } inline bool Position::move_was_passed_pawn_push(Move m) const { Color c = opposite_color(side_to_move()); - return piece_on(move_to(m)) == pawn_of_color(c) + return piece_on(move_to(m)) == piece_of_color_and_type(c, PAWN) && pawn_is_passed(c, move_to(m)); }