diff --git a/CHANGELOG.md b/CHANGELOG.md index f793256..e8d9ba7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### 1.4.1 +- **Potentially breaking**: FEN strings without castling rights specified now default to no castling rights, instead of all castling rights. + ### 1.4.0 - Custom move generation and processing (beta): - `MoveGenerator`: optionally supply a list of these in `Variant.moveGenerators`. These can be used to generate custom moves based on the state. You can generate both normal move types (e.g. add an extra move to a piece on a certain square or something), or totally different types of move that can be managed by `MoveProcessor`. diff --git a/lib/src/fen.dart b/lib/src/fen.dart index c724d1a..f777dbc 100644 --- a/lib/src/fen.dart +++ b/lib/src/fen.dart @@ -72,9 +72,7 @@ ParseFenResult parseFen({ if (!(['w', 'b'].contains(turnStr))) { throw ("Invalid FEN: colour should be 'w' or 'b'"); } - String castlingStr = (strict || sections.length > 2) - ? sections[2] - : 'KQkq'; // TODO: get default castling for variant + String castlingStr = (strict || sections.length > 2) ? sections[2] : '-'; String epStr = (strict || sections.length > 3) ? sections[3] : '-'; String halfMoves = (strict || sections.length > 4) ? sections[4] : '0'; String fullMoves = (strict || sections.length > 5) ? sections[5] : '1'; @@ -88,7 +86,7 @@ ParseFenResult parseFen({ List fileStrings = sections[0].split('/'); List gateStrings = [ fileStrings.removeAt(0), - fileStrings.removeAt(fileStrings.length - 1) + fileStrings.removeAt(fileStrings.length - 1), ]; boardSymbols = fileStrings.join('/').split(''); // rebuild for (int i = 0; i < 2; i++) {