This patch forces leaving of Edit-Position mode before copying a FEN to the clipboard, to make sure castling rights are faked in a consistent way. Before you could get FENs that had castling rights for non-existent Rooks.
{\r
char *fen = NULL;\r
\r
+ if(gameMode == EditPosition) EditPositionDone(TRUE); // [HGM] mak sure castling rights are set consistently\r
fen = PositionToFEN(currentMove, NULL);\r
if (!fen) {\r
DisplayError("Unable to convert position to FEN.", 0);\r