X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovegen.cpp;h=76a27d9f4936320165c0378f2b59225038b0abbe;hp=833cd2fc88ec74d94ae19599408715621773baa6;hb=59d32f8eddf4fc8138f419777fbabf58080f1caa;hpb=cf5d683408a2ef8a1c80be9bf7d6790a38b16277 diff --git a/src/movegen.cpp b/src/movegen.cpp index 833cd2fc..76a27d9f 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -29,7 +29,7 @@ namespace { ExtMove* generate_castling(const Position& pos, ExtMove* moveList) { constexpr CastlingRight Cr = Us | Cs; - constexpr bool KingSide = (Cr == WHITE_OO || Cr == BLACK_OO); + constexpr bool KingSide = (Cs == KING_SIDE); if (pos.castling_impeded(Cr) || !pos.can_castle(Cr)) return moveList; @@ -278,7 +278,7 @@ namespace { *moveList++ = make_move(ksq, pop_lsb(&b)); } - if (Type != CAPTURES && Type != EVASIONS && pos.can_castle(Us)) + if (Type != CAPTURES && Type != EVASIONS && pos.castling_rights(Us)) { if (pos.is_chess960()) {