From 555d9a8711673fd669be03017f92972f5bc4e839 Mon Sep 17 00:00:00 2001 From: Gregor Cramer Date: Mon, 11 Nov 2013 15:54:12 +0100 Subject: [PATCH] Faster castling in Chess960 case Only rook attackers has to be considered, all other attackers are already handled in the lines above. No functional change. --- src/movegen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/movegen.cpp b/src/movegen.cpp index 1524bf1f..a254590b 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -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(kto, pos.pieces() ^ rfrom) & pos.pieces(~us, ROOK, QUEEN))) return mlist; (mlist++)->move = make(kfrom, rfrom); -- 2.39.2