Skip to content

Commit

Permalink
Faster castling in Chess960 case
Browse files Browse the repository at this point in the history
Only rook attackers has to be considered, all other attackers are
already handled in the lines above.

No functional change.
  • Loading branch information
gcramer authored and mcostalba committed Nov 11, 2013
1 parent b9768b8 commit 555d9a8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/movegen.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit 555d9a8

Please sign in to comment.