fixed a bug with pushing pawn moves
This commit is contained in:
1 parent
3a5e6d4151
commit
ac826394bd
1 file changed
+7
-2
+7
-2
@@ -281,8 +281,13 @@ void GenPawnMoves(Board &board, bool color) {
|
|||||||
int direction = color ? south : north;
|
int direction = color ? south : north;
|
||||||
|
|
||||||
Bitboard attacks = pawnAttacks[color][square] & board.colors[!color];
|
Bitboard attacks = pawnAttacks[color][square] & board.colors[!color];
|
||||||
attacks |= (Bitboard::GetSquare(square + direction)
|
|
||||||
| Bitboard::GetSquare(square + 2 * direction)) & ~(board.occupied);
|
Bitboard firstAhead = Bitboard::GetSquare(square + direction) & ~board.occupied;
|
||||||
|
|
||||||
|
if (firstAhead.GetBoard()) {
|
||||||
|
attacks |= firstAhead;
|
||||||
|
attacks |= Bitboard::GetSquare(square + 2 * direction) & ~board.occupied;
|
||||||
|
}
|
||||||
|
|
||||||
while (attacks.GetBoard()) {
|
while (attacks.GetBoard()) {
|
||||||
int targetSquare = attacks.getLS1BIndex();
|
int targetSquare = attacks.getLS1BIndex();
|
||||||
|
|||||||
Reference in new issue
Block a user