diff --git a/.github/workflows/try_compile.yml b/.github/workflows/try_compile.yml index ac4ae2b..3c811f5 100644 --- a/.github/workflows/try_compile.yml +++ b/.github/workflows/try_compile.yml @@ -1,7 +1,6 @@ name: CMake on multiple platforms on: - push: pull_request: jobs: diff --git a/position.cpp b/position.cpp index 75cd91f..208f58e 100644 --- a/position.cpp +++ b/position.cpp @@ -196,6 +196,7 @@ template void _Position::setFEN(const s current_state = HistoryEntry(); history.clear(); _chess960 = chess960; + std::fill(std::begin(pieces_list), std::end(pieces_list), PieceC::NO_PIECE); std::istringstream ss(str); std::string board_fen, active_color, castling, enpassant; int halfmove = 0, fullmove = 1; diff --git a/tests.cpp b/tests.cpp index 84c1d73..179d80d 100644 --- a/tests.cpp +++ b/tests.cpp @@ -1330,6 +1330,11 @@ TEST_CASE("Experienced bugs in this repo") { REQUIRE(p.getCastlingPath(BLACK, true) == 0x6000000000000000ULL); REQUIRE(p.getCastlingPath(BLACK, false) == 0xe00000000000000ULL); } + { + Position p; + p.setFEN("1nbqkbnr/1ppppppp/r7/8/4P3/8/PPPP1PPP/RNBQK1NR w KQk - 0 3"); + REQUIRE(p.fen() == "1nbqkbnr/1ppppppp/r7/8/4P3/8/PPPP1PPP/RNBQK1NR w KQk - 0 3"); + } } TEST_CASE("Captures only?") { std::vector> tests = {