X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fposition.cpp;h=2b52750136998aa1a183ad5043c7dec14358f63d;hb=8365f8ac1ee7f62db18fca8498b3fdb1640674d9;hp=b9a8bf8bf26f47d365eb70110714ca9846fd1937;hpb=76381cbd6903f8be571cbc0d644a0f78026134bc;p=stockfish diff --git a/src/position.cpp b/src/position.cpp index b9a8bf8b..2b527501 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -379,19 +379,6 @@ Bitboard Position::hidden_checks(Color c, Square ksq) const { } -/// Position::square_is_attacked() checks whether the given side attacks the -/// given square. - -bool Position::square_is_attacked(Square s, Color c) const { - - return (pawn_attacks(opposite_color(c), s) & pawns(c)) - || (piece_attacks(s) & knights(c)) - || (piece_attacks(s) & kings(c)) - || (piece_attacks(s) & rooks_and_queens(c)) - || (piece_attacks(s) & bishops_and_queens(c)); -} - - /// Position::attacks_to() computes a bitboard containing all pieces which /// attacks a given square. There are two versions of this function: One /// which finds attackers of both colors, and one which only finds the @@ -407,12 +394,6 @@ Bitboard Position::attacks_to(Square s) const { | (piece_attacks(s) & pieces_of_type(KING)); } -Bitboard Position::attacks_to(Square s, Color c) const { - - return attacks_to(s) & pieces_of_color(c); -} - - /// Position::piece_attacks_square() tests whether the piece on square f /// attacks square t.