Fix attack bitboard for non-king royal pieces
authorFabian Fichter <ianfab@users.noreply.github.com>
Sun, 12 Jan 2020 21:53:57 +0000 (22:53 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Mon, 13 Jan 2020 22:04:14 +0000 (23:04 +0100)
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

src/position.h

index bec0dc0..f900a34 100644 (file)
@@ -796,7 +796,7 @@ inline Square Position::castling_rook_square(CastlingRights cr) const {
 
 template<PieceType Pt>
 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 {