From 7646b2b839896621241f45e44926275a25346568 Mon Sep 17 00:00:00 2001 From: Ada Joule Date: Sun, 13 Feb 2022 17:34:17 +0700 Subject: [PATCH] Make castling through flying general illegal Remove the illegality for pseudo-royal --- src/position.cpp | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) 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 -- 1.7.0.4