]> git.sesse.net Git - stockfish/commitdiff
Faster castling in Chess960 case
authorGregor Cramer <remarcg@gmx.net>
Mon, 11 Nov 2013 14:54:12 +0000 (15:54 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 11 Nov 2013 14:55:08 +0000 (15:55 +0100)
Only rook attackers has to be considered, all other attackers are
already handled in the lines above.

No functional change.

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.
     // 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);
         return mlist;
 
     (mlist++)->move = make<CASTLE>(kfrom, rfrom);