Skip to content

Commit

Permalink
Fix advisor attack generation
Browse files Browse the repository at this point in the history
  • Loading branch information
skystarspython committed Jun 5, 2024
1 parent 58e2007 commit fc1322b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/bitboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ void Bitboards::init() {
PseudoAttacks[BISHOP][s1] = attacks_bb<BISHOP>(s1, 0);
PseudoAttacks[KNIGHT][s1] = attacks_bb<KNIGHT>(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)
Expand Down

0 comments on commit fc1322b

Please sign in to comment.