X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fposition.cpp;h=f5ff3da1862b29cf40d75a4b55e5c86ca1d3f8f3;hp=6bbb7914ae805e2a6302c0fa6106c9f0f923f483;hb=383b12e1a5cc03a122e9a071eebde87eac85b116;hpb=209e94203f8c4d0a48405192d1e71c80f28f3159 diff --git a/src/position.cpp b/src/position.cpp index 6bbb7914..f5ff3da1 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -306,7 +306,7 @@ void Position::set_castling_right(Color c, Square rfrom) { Square rto = relative_square(c, cr & KING_SIDE ? SQ_F1 : SQ_D1); castlingPath[cr] = (between_bb(rfrom, rto) | between_bb(kfrom, kto) | rto | kto) - & ~(square_bb(kfrom) | rfrom); + & ~(kfrom | rfrom); } @@ -591,7 +591,7 @@ bool Position::pseudo_legal(const Move m) const { if ( !(attacks_from(from, us) & pieces(~us) & to) // Not a capture && !((from + pawn_push(us) == to) && empty(to)) // Not a single push && !( (from + 2 * pawn_push(us) == to) // Not a double push - && (rank_of(from) == relative_rank(us, RANK_2)) + && (relative_rank(us, from) == RANK_2) && empty(to) && empty(to - pawn_push(us)))) return false;