Fix OO-castling in FRC after pasting FEN
authorH.G. Muller <h.g.muller@hccnet.nl>
Sun, 17 Jan 2010 13:24:12 +0000 (14:24 +0100)
committerArun Persaud <arun@nubati.net>
Sun, 17 Jan 2010 19:02:28 +0000 (11:02 -0800)
Because the FEN parser did not set initialRights, the rights from the
previous game kept hanging there, and prevented recognition of
OO-castling (although KxR castling was still understood).

backend.c

index a220324..28c5546 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -13981,6 +13981,8 @@ ParseFEN(board, blackPlaysFirst, fen)
               }
         }
       }
+      for(i=0; i<nrCastlingRights; i++)
+        if(FENcastlingRights[i] >= 0) initialRights[i] = FENcastlingRights[i];
     if (appData.debugMode) {
         fprintf(debugFP, "FEN castling rights:");
         for(i=0; i<nrCastlingRights; i++)