]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Better condition in is_pseudo_legal()
[stockfish] / src / position.cpp
index 55f8bcff5cd960bbcb4234e72e4d4fd8900f9d10..f7a89e07f3d88afacdf7f6ae18b80a706834d77e 100644 (file)
@@ -542,7 +542,7 @@ bool Position::is_pseudo_legal(const Move m) const {
       return false;
 
   // The destination square cannot be occupied by a friendly piece
-  if (piece_on(to) != NO_PIECE && color_of(piece_on(to)) == us)
+  if (pieces(us) & to)
       return false;
 
   // Handle the special case of a pawn move