bugfix in check evasion
This commit is contained in:
1 parent
b4dc7125f9
commit
1a25479a8c
2 files changed
+5
-3
No files matched your search
+3
-2
@@ -824,6 +824,7 @@ static void GenCheckEvasions(Board &board, bool color) {
|
||||
|
||||
if (checkerType == Rook || checkerType == Bishop || checkerType == Queen) {
|
||||
pushMask = SliderRayToSquare(checkerSquare, kingSquare);
|
||||
pushMask.PopBit(kingSquare);
|
||||
}
|
||||
|
||||
// looping through own pieces to add captures and blocks
|
||||
@@ -843,15 +844,15 @@ static void GenCheckEvasions(Board &board, bool color) {
|
||||
|
||||
if (type == Pawn) {
|
||||
pushes |= getPawnPushes(square, color, board.occupied) & pushMask;
|
||||
|
||||
// Checking for en passant capture
|
||||
if ((pawnAttacks[color][square]
|
||||
& Bitboard::GetSquare(board.enPassantTarget)).GetBoard()) {
|
||||
board.AddMove(Move(square, board.enPassantTarget, epCapture));
|
||||
}
|
||||
} else {
|
||||
pushes |= getPieceAttacks(square, type, color, board.occupied.GetBoard()) & pushMask;
|
||||
}
|
||||
|
||||
pushes |= getPieceAttacks(square, type, color, board.occupied.GetBoard()) & pushMask;
|
||||
captures |= getPieceAttacks(square, type, color, board.occupied.GetBoard()) & captureMask;
|
||||
|
||||
while (captures.GetBoard()) {
|
||||
|
||||
Reference in new issue
Block a user