fixed a bug with IsPinned function
This commit is contained in:
1 parent
825e553ca3
commit
3a7531cd3d
1 file changed
+4
-4
+4
-4
@@ -373,8 +373,8 @@ static bool IsPinned(Board &board, int square, int color) {
|
|||||||
if (attackerColor == !color && (attackerType == Rook
|
if (attackerColor == !color && (attackerType == Rook
|
||||||
|| attackerType == Bishop || attackerType == Queen)) {
|
|| attackerType == Bishop || attackerType == Queen)) {
|
||||||
pinner = true;
|
pinner = true;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
currentSquare += -directionToKing;
|
currentSquare += -directionToKing;
|
||||||
}
|
}
|
||||||
@@ -452,9 +452,6 @@ static void GenCheckEvasions(Board &board, bool color) {
|
|||||||
Bitboard currentPiece = board.colors[color] & board.pieces[type];
|
Bitboard currentPiece = board.colors[color] & board.pieces[type];
|
||||||
|
|
||||||
while (currentPiece.GetBoard()) {
|
while (currentPiece.GetBoard()) {
|
||||||
Bitboard captures;
|
|
||||||
Bitboard pushes;
|
|
||||||
|
|
||||||
int square = currentPiece.getLS1BIndex();
|
int square = currentPiece.getLS1BIndex();
|
||||||
|
|
||||||
if (IsPinned(board, square, color)) {
|
if (IsPinned(board, square, color)) {
|
||||||
@@ -462,6 +459,9 @@ static void GenCheckEvasions(Board &board, bool color) {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Bitboard captures;
|
||||||
|
Bitboard pushes;
|
||||||
|
|
||||||
if (type == Pawn) {
|
if (type == Pawn) {
|
||||||
pushes |= getPawnPushes(square, color, board.occupied) & pushMask;
|
pushes |= getPawnPushes(square, color, board.occupied) & pushMask;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in new issue
Block a user