From 6709b01903b9122cf619e8469a0bea96097447e7 Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sun, 13 Sep 2009 16:13:49 +0100 Subject: [PATCH] Fix semantic of piece_attacks Return the bitboard with the pawn attacks for both colors so to be aligned to the meaning of the others piece_attacks templates. No functional change. Signed-off-by: Marco Costalba --- src/position.cpp | 2 +- src/position.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index 8ec82beb..462088e0 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -667,7 +667,7 @@ inline void Position::update_checkers(Bitboard* pCheckersBB, Square ksq, Square else if ( Piece != KING && !Slider - && bit_is_set(piece_attacks(ksq), to)) + && bit_is_set(Piece == PAWN ? pawn_attacks(opposite_color(sideToMove), ksq) : piece_attacks(ksq), to)) set_bit(pCheckersBB, to); // Discovery checks diff --git a/src/position.h b/src/position.h index 0006fbc7..11cdc132 100644 --- a/src/position.h +++ b/src/position.h @@ -457,7 +457,7 @@ inline Bitboard Position::piece_attacks(Square s) const { template<> inline Bitboard Position::piece_attacks(Square s) const { - return StepAttackBB[piece_of_color_and_type(opposite_color(sideToMove), PAWN)][s]; + return StepAttackBB[WP][s] | StepAttackBB[BP][s]; } template<> -- 2.39.2