Skip to content

Commit 555d9a8

Browse files
gcramermcostalba
authored andcommitted
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.
1 parent b9768b8 commit 555d9a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/movegen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace {
5656
// Because we generate only legal castling moves we need to verify that
5757
// when moving the castling rook we do not discover some hidden checker.
5858
// For instance an enemy queen in SQ_A1 when castling rook is in SQ_B1.
59-
if (Chess960 && (pos.attackers_to(kto, pos.pieces() ^ rfrom) & enemies))
59+
if (Chess960 && (attacks_bb<ROOK>(kto, pos.pieces() ^ rfrom) & pos.pieces(~us, ROOK, QUEEN)))
6060
return mlist;
6161

6262
(mlist++)->move = make<CASTLE>(kfrom, rfrom);

0 commit comments

Comments
 (0)