fixed a bug with IsPinned function

This commit is contained in:
rektdie committed 2024-04-07 23:05:39 +02:00
1 parent 825e553ca3
commit 3a7531cd3d
1 file changed
+4 -4
+4 -4
View File
@@ -373,8 +373,8 @@ static bool IsPinned(Board &board, int square, int color) {
if (attackerColor == !color && (attackerType == Rook
|| attackerType == Bishop || attackerType == Queen)) {
pinner = true;
break;
}
break;
}
currentSquare += -directionToKing;
}
@@ -452,9 +452,6 @@ static void GenCheckEvasions(Board &board, bool color) {
Bitboard currentPiece = board.colors[color] & board.pieces[type];
while (currentPiece.GetBoard()) {
Bitboard captures;
Bitboard pushes;
int square = currentPiece.getLS1BIndex();
if (IsPinned(board, square, color)) {
@@ -462,6 +459,9 @@ static void GenCheckEvasions(Board &board, bool color) {
continue;
}
Bitboard captures;
Bitboard pushes;
if (type == Pawn) {
pushes |= getPawnPushes(square, color, board.occupied) & pushMask;
} else {