1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00

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.
This commit is contained in:
Gregor Cramer 2013-11-11 15:54:12 +01:00 committed by Marco Costalba
parent b9768b8bc5
commit 555d9a8711

View 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);