From: Fabian Fichter Date: Wed, 7 Nov 2018 20:02:23 +0000 (+0100) Subject: Fix #11 Sittuyin promotion bug X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=bf85fd6a51cdd1acc00381a152e91e2765a36288;p=fairystockfish.git Fix #11 Sittuyin promotion bug Fix check detection for Sittuyin promotions. --- diff --git a/src/position.cpp b/src/position.cpp index 2400b54..e14ca16 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -894,8 +894,7 @@ bool Position::gives_check(Move m) const { // Is there a discovered check? if ( type_of(m) != DROP && (st->blockersForKing[~sideToMove] & from) - && ( !aligned(from, to, square(~sideToMove)) - || (attackers_to(square(~sideToMove), (pieces() ^ from) | to) & pieces(sideToMove)))) + && (attackers_to(square(~sideToMove), (pieces() ^ from) | to) & pieces(sideToMove))) return true; switch (type_of(m)) diff --git a/tests/perft.sh b/tests/perft.sh index 1163dd3..4a54d0b 100755 --- a/tests/perft.sh +++ b/tests/perft.sh @@ -50,6 +50,7 @@ expect perft.exp horde startpos 6 5396554 > /dev/null expect perft.exp placement startpos 4 1597696 > /dev/null expect perft.exp sittuyin startpos 3 580096 > /dev/null expect perft.exp sittuyin "fen 8/8/6R1/s3r3/P5R1/1KP3p1/1F2kr2/8[-] b - - 0 72" 4 657824 > /dev/null +expect perft.exp sittuyin "fen 2r5/6k1/6p1/3s2P1/3npR2/8/p2N2F1/3K4 w - - 1 50" 4 394031 > /dev/null rm perft.exp