From: Fabian Fichter Date: Sat, 4 Sep 2021 14:45:43 +0000 (+0200) Subject: Fix pawn evasions for cannon checks X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=6f28696fa47291179fa4dce277cbca74d2670d6e;p=fairystockfish.git Fix pawn evasions for cannon checks --- diff --git a/src/movegen.cpp b/src/movegen.cpp index 9754c8d..4daa190 100644 --- a/src/movegen.cpp +++ b/src/movegen.cpp @@ -116,7 +116,7 @@ namespace { & ~shift(forward_ranks_bb(Us, relative_rank(Us, pos.double_step_rank_max(), pos.max_rank()))); const Bitboard emptySquares = Type == QUIETS || Type == QUIET_CHECKS ? target : ~pos.pieces(); - const Bitboard enemies = Type == EVASIONS ? pos.checkers() + const Bitboard enemies = Type == EVASIONS ? (pos.checkers() & pos.non_sliding_riders() ? pos.pieces(Them) : pos.checkers()) : Type == CAPTURES ? target : pos.pieces(Them); Bitboard pawnsOn7 = pos.pieces(Us, PAWN) & TRank7BB; diff --git a/tests/perft.sh b/tests/perft.sh index 70a92a2..946f88a 100755 --- a/tests/perft.sh +++ b/tests/perft.sh @@ -132,6 +132,8 @@ if [[ $1 == "all" || $1 == "largeboard" ]]; then expect perft.exp grand startpos 3 259514 > /dev/null expect perft.exp grand "fen r8r/1nbqkcabn1/ppp2ppppp/3p6/4pP4/10/10/PPPPP1PPPP/1NBQKCABN1/R8R w - e7 0 3" 2 5768 > /dev/null expect perft.exp opulent startpos 3 133829 > /dev/null + expect perft.exp shako "fen 4kc3c/ernbq1b1re/ppp3p1pp/3p2pp2/4p5/5P4/2PN2P3/PP1PP2PPP/ER1BQKBNR1/5C3C w KQ - 0 9" 3 26325 > /dev/null + expect perft.exp shako "fen 4ncr1k1/1cr2P4/pp2p2pp1/P7PN/2Ep1p4/B3P1eN2/2P1n1P3/1B1P1K4/9p/5C2CR w - - 0 1" 3 180467 > /dev/null expect perft.exp xiangqi startpos 4 3290240 > /dev/null expect perft.exp xiangqi "fen 1rbaka2R/5r3/6n2/2p1p1p2/4P1bP1/PpC3Bc1/1nPR2P2/2N2AN2/1c2K1p2/2BAC4 w - - 0 1" 4 4485547 > /dev/null expect perft.exp xiangqi "fen 4kcP1N/8n/3rb4/9/9/9/9/3p1A3/4K4/5CB2 w - - 0 1" 4 92741 > /dev/null