X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovegen.cpp;fp=src%2Fmovegen.cpp;h=fafa65ee53f11100d396d717bb374ee32a5032aa;hp=aaa1ff88bdb810b9cf05950a4bf4bc4d43e720ab;hb=5f222f1d98c9b4cb07aa2303f085c2064e7ea77a;hpb=0266e702970640df693a8e572dd3cb9d227cdfc6 diff --git a/src/movegen.cpp b/src/movegen.cpp index aaa1ff88..fafa65ee 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -156,10 +156,8 @@ namespace { { assert(rank_of(pos.ep_square()) == relative_rank(Us, RANK_6)); - // An en passant capture can be an evasion only if the checking piece - // is the double pushed pawn and so is in the target. Otherwise this - // is a discovery check and we are forced to do otherwise. - if (Type == EVASIONS && !(target & (pos.ep_square() - Up))) + // An en passant capture cannot resolve a discovered check. + if (Type == EVASIONS && (target & (pos.ep_square() + Up))) return moveList; b1 = pawnsNotOn7 & pawn_attacks_bb(Them, pos.ep_square());