diff --git a/src/position.cpp b/src/position.cpp index d14385b13..f4477ddf2 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -752,26 +752,8 @@ bool Position::pseudo_legal(const Move m) const { else if (!(attacks_bb(type_of(pc), from, pieces()) & to)) return false; - // Evasions generator already takes care to avoid some kind of illegal moves - // and legal() relies on this. We therefore have to take care that the same - // kind of moves are filtered out here. if (checkers()) - { - if (type_of(pc) != KING) - { - // Double check? In this case, a king move is required - if (more_than_one(checkers())) - return false; - - // Our move must be a blocking interposition or a capture of the checking piece - if (!(between_bb(square(us), lsb(checkers())) & to)) - return false; - } - // In case of king moves under check we have to remove the king so as to catch - // invalid moves like b1a1 when opposite queen is on c1. - else if (attackers_to_exist(to, pieces() ^ from, ~us)) - return false; - } + return MoveList(*this).contains(m); return true; }