X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fposition.cpp;h=be4e234d99d9b937036ee9d6fabb9cec170a0e40;hb=deecb3757ca03fa2c9ebc87fd9efe4c2ba05f740;hp=4a0075cb841845bff231bd8a8091404b16ea7b5e;hpb=53c2bf069752d9d15d1678d79b0490b33ef240b4;p=stockfish diff --git a/src/position.cpp b/src/position.cpp index 4a0075cb..be4e234d 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -470,7 +470,6 @@ bool Position::pl_move_is_legal(Move m, Bitboard pinned) const { assert(is_ok()); assert(move_is_ok(m)); assert(pinned == pinned_pieces(side_to_move())); - assert(!is_check()); // Castling moves are checked for legality during move generation. if (move_is_castle(m)) @@ -482,7 +481,7 @@ bool Position::pl_move_is_legal(Move m, Bitboard pinned) const { assert(color_of_piece_on(from) == us); assert(piece_on(king_square(us)) == piece_of_color_and_type(us, KING)); - // En passant captures are a tricky special case. Because they are + // En passant captures are a tricky special case. Because they are // rather uncommon, we do it simply by testing whether the king is attacked // after the move is made if (move_is_ep(m)) @@ -1706,8 +1705,7 @@ bool Position::is_draw() const { bool Position::is_mate() const { MoveStack moves[256]; - - return is_check() && (generate_evasions(*this, moves, pinned_pieces(sideToMove)) == moves); + return is_check() && (generate_moves(*this, moves, false) == moves); }