X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fmovegen.cpp;h=995f54f06c97b1f352b4cbb2ecfa8f2831070b9d;hp=1135c21976f416a9bf0116f0936972dc9bde2afe;hb=3d0b60b0653852198011306a4c8d34f8ef98fc5e;hpb=f1591447cf791b6c0ed4710df7eb688c65c4c20e diff --git a/src/movegen.cpp b/src/movegen.cpp index 1135c219..995f54f0 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -393,7 +393,6 @@ bool move_is_legal(const Position& pos, const Move m, Bitboard pinned) { assert(pinned == pos.pinned_pieces(pos.side_to_move())); Color us = pos.side_to_move(); - Color them = opposite_color(us); Square from = move_from(m); Piece pc = pos.piece_on(from); @@ -402,6 +401,7 @@ bool move_is_legal(const Position& pos, const Move m, Bitboard pinned) { if (color_of_piece(pc) != us) return false; + Color them = opposite_color(us); Square to = move_to(m); // En passant moves