Fix parsing of O-O and O-O-O after FEN pasting in FRC
authorH.G. Muller <h.g.muller@hccnet.nl>
Sun, 17 Jan 2010 13:17:10 +0000 (14:17 +0100)
committerArun Persaud <arun@nubati.net>
Sun, 17 Jan 2010 18:53:42 +0000 (10:53 -0800)
Because the initial rights were not set in the FEN reader, the
initial rights of the previous game remained in force, so that the
parser did not understand OO-castling (although it would allow KxR
castling).

backend.c

index 7a8aee2..3480a11 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -14220,6 +14220,8 @@ ParseFEN(board, blackPlaysFirst, fen)
               }
         }
       }
+      for(i=0; i<nrCastlingRights; i++)
+        if(board[CASTLING][i] != NoRights) initialRights[i] = board[CASTLING][i];
     if (appData.debugMode) {
         fprintf(debugFP, "FEN castling rights:");
         for(i=0; i<nrCastlingRights; i++)