projects
/
fairystockfish.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
28f010c
)
Fix pseudo-legal move validation for Janggi
author
Fabian Fichter
<ianfab@users.noreply.github.com>
Wed, 12 Aug 2020 20:31:20 +0000 (22:31 +0200)
committer
Fabian Fichter
<ianfab@users.noreply.github.com>
Wed, 12 Aug 2020 20:31:20 +0000 (22:31 +0200)
Closes #170.
src/position.cpp
patch
|
blob
|
history
diff --git
a/src/position.cpp
b/src/position.cpp
index
5b7be11
..
8b3360f
100644
(file)
--- a/
src/position.cpp
+++ b/
src/position.cpp
@@
-1052,7
+1052,7
@@
bool Position::pseudo_legal(const Move m) const {
// Evasions generator already takes care to avoid some kind of illegal moves
// and legal() relies on this. We therefore have to take care that the same
// kind of moves are filtered out here.
- if (checkers() & ~(pieces(CANNON, BANNER) | pieces(HORSE, ELEPHANT) | pieces(JANGGI_CANNON, JANGGI_ELEPHANT)))
+ if (checkers() && !(checkers() & (pieces(CANNON, BANNER) | pieces(HORSE, ELEPHANT) | pieces(JANGGI_CANNON, JANGGI_ELEPHANT))))
{
if (type_of(pc) != KING)
{