projects
/
xboard.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
2f104b7
)
Fix check testing in games without King
author
H.G.Muller
<hgm@hgm-xboard.(none)>
Sun, 17 Jul 2016 21:53:17 +0000 (23:53 +0200)
committer
H.G.Muller
<hgm@hgm-xboard.(none)>
Sun, 17 Jul 2016 21:53:17 +0000 (23:53 +0200)
A position without King was always considered as in check (because of
Atomic), which is rather illogical and undesirable in games where no
King participates (as it makes every move illegal).
moves.c
patch
|
blob
|
history
diff --git
a/moves.c
b/moves.c
index
25263c8
..
2f6a706
100644
(file)
--- a/
moves.c
+++ b/
moves.c
@@
-1735,6
+1735,8
@@
CheckTest (Board board, int flags, int rf, int ff, int rt, int ft, int enPassant
}
}
+ if(PieceToChar(king) == '.') return 0; // never in check if the royal piece does not participate
+
if (rt >= 0) {
if (enPassant) {
captured = board[rf][ft];