]> git.sesse.net Git - stockfish/blobdiff - src/movegen.cpp
Split killer moves from non-captures
[stockfish] / src / movegen.cpp
index a783a6251b8b7ca6319d127cb7b1eb8842fa8dbb..3845cd978cab815b5d9e83eb27de9ba536d58437 100644 (file)
@@ -392,7 +392,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);
 
@@ -401,6 +400,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