]> git.sesse.net Git - stockfish/blobdiff - src/movegen.cpp
Faster castling in Chess960 case
[stockfish] / src / movegen.cpp
index 1524bf1f2453baa1152e9c95874209c91184d04c..a254590b1286fa8aa02a529d915c377f90c9efe1 100644 (file)
@@ -56,7 +56,7 @@ namespace {
     // Because we generate only legal castling moves we need to verify that
     // when moving the castling rook we do not discover some hidden checker.
     // For instance an enemy queen in SQ_A1 when castling rook is in SQ_B1.
-    if (Chess960 && (pos.attackers_to(kto, pos.pieces() ^ rfrom) & enemies))
+    if (Chess960 && (attacks_bb<ROOK>(kto, pos.pieces() ^ rfrom) & pos.pieces(~us, ROOK, QUEEN)))
         return mlist;
 
     (mlist++)->move = make<CASTLE>(kfrom, rfrom);