franciscoBSalgueiro / en-croissant

The Ultimate Chess Toolkit
https://encroissant.org
GNU General Public License v3.0
641 stars 80 forks source link

FEN setup with invalid castling rights when editing #410

Closed jez9999 closed 1 month ago

jez9999 commented 1 month ago

Describe the bug

When editing the analysis board, the FEN can become invalid for a game of normal chess (possibly it's Chess960 notation?) resulting in the Stockfish engine giving the error "illegal position: invalid castling rights" when turned on.

Reproduction

  1. Open new analysis board
  2. Edit mode
  3. Move white bishop to F3
  4. Move white knight to G3
  5. Move white king to G1 (castles)
  6. Select "black to move"
  7. FEN is now "rnbqkbnr/pppppppp/8/8/8/5BN1/PPPPPPPP/RNBQ1RK1 b HQkq - 0 1", HQkq invalid for regular chess.
  8. Analysis | Run, error message from Stockfish.

Platform and versions

Windows 10, en croissant version 0.11.1

Stack trace

No response

franciscoBSalgueiro commented 1 month ago

duplicate of #346