X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=cd297df737839e15967b37a280f7cc054c8a70c0;hp=e73c8ff5d9d3c78406f346f5b7582aef2e4c7f0a;hb=034a2b04f2fc1017721b4f3fc12895e5f8a190bd;hpb=f22a63ce67fecabe14dd4e558af9483b592efcfa diff --git a/src/position.h b/src/position.h index e73c8ff5..cd297df7 100644 --- a/src/position.h +++ b/src/position.h @@ -108,13 +108,12 @@ public: // Checking Bitboard checkers() const; Bitboard discovered_check_candidates() const; - Bitboard pinned_pieces() const; + Bitboard pinned_pieces(Color toMove) const; // Attacks to/from a given square Bitboard attackers_to(Square s) const; Bitboard attackers_to(Square s, Bitboard occ) const; Bitboard attacks_from(Piece p, Square s) const; - static Bitboard attacks_from(Piece p, Square s, Bitboard occ); template Bitboard attacks_from(Square s) const; template Bitboard attacks_from(Square s, Color c) const; @@ -175,7 +174,7 @@ private: // Helper functions void do_castle(Square kfrom, Square kto, Square rfrom, Square rto); - Bitboard hidden_checkers(Square ksq, Color c) const; + Bitboard hidden_checkers(Square ksq, Color c, Color toMove) const; void put_piece(Square s, Color c, PieceType pt); void remove_piece(Square s, Color c, PieceType pt); void move_piece(Square from, Square to, Color c, PieceType pt); @@ -304,7 +303,7 @@ inline Bitboard Position::attacks_from(Square s, Color c) const { } inline Bitboard Position::attacks_from(Piece p, Square s) const { - return attacks_from(p, s, byTypeBB[ALL_PIECES]); + return attacks_bb(p, s, byTypeBB[ALL_PIECES]); } inline Bitboard Position::attackers_to(Square s) const { @@ -316,11 +315,11 @@ inline Bitboard Position::checkers() const { } inline Bitboard Position::discovered_check_candidates() const { - return hidden_checkers(king_square(~sideToMove), sideToMove); + return hidden_checkers(king_square(~sideToMove), sideToMove, sideToMove); } -inline Bitboard Position::pinned_pieces() const { - return hidden_checkers(king_square(sideToMove), ~sideToMove); +inline Bitboard Position::pinned_pieces(Color toMove) const { + return hidden_checkers(king_square(toMove), ~toMove, toMove); } inline bool Position::pawn_passed(Color c, Square s) const {