projects
/
fairystockfish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
5156bed
)
Make castling through flying general illegal
author
Ada Joule
<ada.fulmina@gmail.com>
Sun, 13 Feb 2022 10:34:17 +0000 (17:34 +0700)
committer
Fabian Fichter
<ianfab@users.noreply.github.com>
Sun, 13 Feb 2022 19:00:37 +0000 (20:00 +0100)
Remove the illegality for pseudo-royal
src/position.cpp
patch
|
blob
|
history
diff --git
a/src/position.cpp
b/src/position.cpp
index
81de344
..
84340a8
100644
(file)
--- 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