From: Fabian Fichter Date: Sun, 12 Jan 2020 21:53:57 +0000 (+0100) Subject: Fix attack bitboard for non-king royal pieces X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=5097d7ed866f163f344f68ed72348a574d38b6cd;p=fairystockfish.git Fix attack bitboard for non-king royal pieces knightmate STC LLR: 3.00 (-2.94,2.94) [-10.00,5.00] Total: 308 W: 114 L: 67 D: 127 http://www.variantfishtest.org:6543/tests/view/5e1b95bd6e23db695c3fd2c2 knightmate LTC LLR: 2.98 (-2.94,2.94) [-10.00,5.00] Total: 343 W: 121 L: 75 D: 147 http://www.variantfishtest.org:6543/tests/view/5e1b963f6e23db695c3fd2c5 --- diff --git a/src/position.h b/src/position.h index bec0dc0..f900a34 100644 --- a/src/position.h +++ b/src/position.h @@ -796,7 +796,7 @@ inline Square Position::castling_rook_square(CastlingRights cr) const { template inline Bitboard Position::attacks_from(Square s, Color c) const { - return attacks_bb(c, Pt, s, byTypeBB[ALL_PIECES]) & board_bb(c, Pt); + return attacks_bb(c, Pt == KING ? king_type() : Pt, s, byTypeBB[ALL_PIECES]) & board_bb(c, Pt); } inline Bitboard Position::attacks_from(Color c, PieceType pt, Square s) const {