diff --git a/source/main.cpp b/source/main.cpp index 8617e01..c481de2 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -9,7 +9,7 @@ int main() { initSliderAttacks(); Board board; - board.SetByFen("r3k2r/Pppp1ppp/1b3nbN/nP6/BBP1P3/q4N2/Pp1P2PP/R2Q1RK1 w kq - 0 1"); + board.SetByFen("rnbq1k1r/pp1Pbppp/2p5/8/2B5/8/PPP1NnPP/RNBQK2R w KQ - 1 8"); Perft(board, 6); return 0; diff --git a/source/movegen.cpp b/source/movegen.cpp index 15cf756..1281913 100644 --- a/source/movegen.cpp +++ b/source/movegen.cpp @@ -440,7 +440,7 @@ static bool IsLegalEnPassant(Board &board, int square) { // Either east or west if (abs(directionToKing) == 1) { - int currentSq = square - directionToKing; + int currentSq = kingSquare.getLS1BIndex() - directionToKing; Bitboard endingFile = directionToKing > 0 ? files[H] : files[A];