X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovegen.cpp;h=817b4f98f0763f01007e728299b23ff5ca8a5696;hp=bc56548da09f75fd27d4a9c8167f5de83bae100d;hb=2c955f25de9d4c263b6e6d37fef06b378eec49a0;hpb=f32992f88c16c6d4c2b72164c88fc4581f8faba7 diff --git a/src/movegen.cpp b/src/movegen.cpp index bc56548d..817b4f98 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -467,8 +467,8 @@ bool move_is_legal(const Position& pos, const Move m, Bitboard pinned) { illegal = true; if ( square_file(to) == FILE_B - && ( pos.piece_on(to + DELTA_W) == rook_of_color(them) - || pos.piece_on(to + DELTA_W) == queen_of_color(them))) + && ( pos.piece_on(to + DELTA_W) == piece_of_color_and_type(them, ROOK) + || pos.piece_on(to + DELTA_W) == piece_of_color_and_type(them, QUEEN))) illegal = true; return !illegal; @@ -888,8 +888,8 @@ namespace { if ( Side == QUEEN_SIDE && square_file(rsq) == FILE_B - && ( pos.piece_on(relative_square(us, SQ_A1)) == rook_of_color(them) - || pos.piece_on(relative_square(us, SQ_A1)) == queen_of_color(them))) + && ( pos.piece_on(relative_square(us, SQ_A1)) == piece_of_color_and_type(them, ROOK) + || pos.piece_on(relative_square(us, SQ_A1)) == piece_of_color_and_type(them, QUEEN))) illegal = true; if (!illegal)