From: Ada Joule Date: Sun, 13 Feb 2022 10:34:17 +0000 (+0700) Subject: Make castling through flying general illegal X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=7646b2b839896621241f45e44926275a25346568;p=fairystockfish.git Make castling through flying general illegal Remove the illegality for pseudo-royal --- diff --git a/src/position.cpp b/src/position.cpp index 81de344..84340a8 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1086,7 +1086,8 @@ bool Position::legal(Move m) const { return true; for (Square s = to; s != from; s += step) - if (attackers_to(s, ~us)) + if (attackers_to(s, ~us) + || (var->flyingGeneral && (attacks_bb(~us, ROOK, s, pieces() ^ from) & pieces(~us, KING)))) return false; // In case of Chess960, verify if the Rook blocks some checks