From fc1322b952df5a6fa5c65bb08b291a3f55ba5c4b Mon Sep 17 00:00:00 2001 From: skystarspython <110183782+skystarspython@users.noreply.github.com> Date: Thu, 6 Jun 2024 00:34:57 +0800 Subject: [PATCH] Fix advisor attack generation --- src/bitboard.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bitboard.cpp b/src/bitboard.cpp index 4ab14a9..63f9926 100644 --- a/src/bitboard.cpp +++ b/src/bitboard.cpp @@ -126,15 +126,15 @@ void Bitboards::init() { PseudoAttacks[BISHOP][s1] = attacks_bb(s1, 0); PseudoAttacks[KNIGHT][s1] = attacks_bb(s1, 0); + for (int step : { NORTH_WEST, NORTH_EAST, SOUTH_WEST, SOUTH_EAST }){ + PseudoAttacks[ADVISOR][s1] |= safe_destination(s1, step); + } + // Only generate pseudo attacks in the palace squares for king and advisor if (Palace & s1) { for (int step : { NORTH, SOUTH, WEST, EAST } ) PseudoAttacks[KING][s1] |= safe_destination(s1, step); PseudoAttacks[KING][s1] &= Palace; - - for (int step : { NORTH_WEST, NORTH_EAST, SOUTH_WEST, SOUTH_EAST }){ - PseudoAttacks[ADVISOR][s1] |= safe_destination(s1, step); - } } for (Square s2 = SQ_A0; s2 <= SQ_I9; ++s2)