diff --git a/source/movegen.cpp b/source/movegen.cpp index aecdc71..a1ce498 100644 --- a/source/movegen.cpp +++ b/source/movegen.cpp @@ -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 {