X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovegen.cpp;h=cb221d95e178e1833c00fb414e183561b02a9924;hp=14f30ea00c01b761748ebb54d284c3e3ba0e8c43;hb=8ab12c901258064f1a9bc531477e1b706bc974fb;hpb=820c5c25b649d6bdd51bed14a16efdc11719b588 diff --git a/src/movegen.cpp b/src/movegen.cpp index 14f30ea0..cb221d95 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -135,7 +135,7 @@ namespace { // if the pawn is not on the same file as the enemy king, because we // don't generate captures. Note that a possible discovery check // promotion has been already generated amongst the captures. - Bitboard dcCandidates = pos.discovered_check_candidates(); + Bitboard dcCandidates = pos.blockers_for_king(Them); if (pawnsNotOn7 & dcCandidates) { Bitboard dc1 = shift(pawnsNotOn7 & dcCandidates) & emptySquares & ~file_bb(ksq); @@ -241,7 +241,7 @@ namespace { && !(PseudoAttacks[Pt][from] & target & pos.check_squares(Pt))) continue; - if (pos.discovered_check_candidates() & from) + if (pos.blockers_for_king(~us) & from) continue; } @@ -336,7 +336,7 @@ ExtMove* generate(const Position& pos, ExtMove* moveList) { assert(!pos.checkers()); Color us = pos.side_to_move(); - Bitboard dc = pos.discovered_check_candidates(); + Bitboard dc = pos.blockers_for_king(~us) & pos.pieces(us); while (dc) { @@ -403,8 +403,9 @@ ExtMove* generate(const Position& pos, ExtMove* moveList) { template<> ExtMove* generate(const Position& pos, ExtMove* moveList) { - Bitboard pinned = pos.pinned_pieces(pos.side_to_move()); - Square ksq = pos.square(pos.side_to_move()); + Color us = pos.side_to_move(); + Bitboard pinned = pos.blockers_for_king(us) & pos.pieces(us); + Square ksq = pos.square(us); ExtMove* cur = moveList; moveList = pos.checkers() ? generate(pos, moveList)