From 7a40cd420707ec05afea47b630267ab0baf95daf Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Wed, 12 Aug 2020 22:31:20 +0200 Subject: [PATCH] Fix pseudo-legal move validation for Janggi Closes #170. --- src/position.cpp | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index 5b7be11..8b3360f 100644 --- 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) { -- 1.7.0.4