X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.h;h=2106414ba2dd4f3475bf5cb42e2149539e939abf;hp=343751ede6201175c894c99c68c002b6495625ff;hb=4ae5a7b45a430aea5f4b21f9455b4db74ed1c44a;hpb=c83cbe42f3a6c9b145a4557ef874222fe685a9bc diff --git a/src/position.h b/src/position.h index 343751ed..2106414b 100644 --- a/src/position.h +++ b/src/position.h @@ -108,6 +108,7 @@ public: Bitboard checkers() const; Bitboard blockers_for_king(Color c) const; Bitboard check_squares(PieceType pt) const; + bool is_discovery_check_on_king(Color c, Move m) const; // Attacks to/from a given square Bitboard attackers_to(Square s) const; @@ -316,6 +317,10 @@ inline Bitboard Position::check_squares(PieceType pt) const { return st->checkSquares[pt]; } +inline bool Position::is_discovery_check_on_king(Color c, Move m) const { + return st->blockersForKing[c] & from_sq(m); +} + inline bool Position::pawn_passed(Color c, Square s) const { return !(pieces(~c, PAWN) & passed_pawn_span(c, s)); }