X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=200416c7bba550900755e6f8d07847cf07a0d35e;hp=e32f8f4973cf4e06f913067baae7e4f38d014318;hb=d316b0277192c3ecca125fbc8a2355aa54ffb3c0;hpb=d9e54ceaa1fb38cc16f2b9f68ea45eff85b7c0f5 diff --git a/src/position.cpp b/src/position.cpp index e32f8f49..200416c7 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -385,8 +385,8 @@ bool Position::square_is_attacked(Square s, Color c) const { Bitboard Position::attacks_to(Square s) const { return - (black_pawn_attacks(s) & pawns(WHITE)) | - (white_pawn_attacks(s) & pawns(BLACK)) | + (pawn_attacks(BLACK, s) & pawns(WHITE)) | + (pawn_attacks(WHITE, s) & pawns(BLACK)) | (piece_attacks(s) & pieces_of_type(KNIGHT)) | (piece_attacks(s) & rooks_and_queens()) | (piece_attacks(s) & bishops_and_queens()) | @@ -847,9 +847,9 @@ void Position::do_move(Move m, UndoInfo &u, Bitboard dcCandidates) { } if(piece == PAWN) { if(abs(int(to) - int(from)) == 16) { - if((us == WHITE && (white_pawn_attacks(from + DELTA_N) & + if((us == WHITE && (pawn_attacks(WHITE, from + DELTA_N) & pawns(BLACK))) || - (us == BLACK && (black_pawn_attacks(from + DELTA_S) & + (us == BLACK && (pawn_attacks(BLACK, from + DELTA_S) & pawns(WHITE)))) { epSquare = Square((int(from) + int(to)) / 2); key ^= zobEp[epSquare]; @@ -1632,8 +1632,8 @@ int Position::see(Square from, Square to) const { (bishop_attacks_bb(to, occ) & bishops_and_queens()) | (piece_attacks(to) & knights()) | (piece_attacks(to) & kings()) | - (white_pawn_attacks(to) & pawns(BLACK)) | - (black_pawn_attacks(to) & pawns(WHITE)); + (pawn_attacks(WHITE, to) & pawns(BLACK)) | + (pawn_attacks(BLACK, to) & pawns(WHITE)); attackers &= occ; // If the opponent has no attackers, we are finished: