Implement castling for variant CRC
authorH.G. Muller <h.g.muller@hccnet.nl>
Wed, 6 Jan 2010 15:56:02 +0000 (16:56 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Wed, 6 Jan 2010 16:02:03 +0000 (17:02 +0100)
moves.c
parser.l

diff --git a/moves.c b/moves.c
index 8ca57be..7835bc9 100644 (file)
--- a/moves.c
+++ b/moves.c
@@ -854,7 +854,7 @@ int GenLegal(board, flags, epfile, castlingRights, callback, closure)
        }
     }
 
-  if(gameInfo.variant == VariantFischeRandom) {
+  if(flags & F_FRC_TYPE_CASTLING) {
 
     /* generate all potential FRC castling moves (KxR), ignoring flags */
     /* [HGM] test if the Rooks we find have castling rights */
index d96b95a..554c5eb 100755 (executable)
--- a/parser.l
+++ b/parser.l
@@ -698,7 +698,7 @@ extern void CopyBoard P((Board to, Board from));
             ft = BOARD_LEFT+2;\r
        }\r
     }\r
-    if(gameInfo.variant == VariantFischeRandom) {\r
+    if(PosFlags(0) & F_FRC_TYPE_CASTLING) {
         if (WhiteOnMove(yyboardindex)) {\r
             ff = initialRights[2];\r
             ft = initialRights[1];\r
@@ -755,7 +755,7 @@ extern void CopyBoard P((Board to, Board from));
             ft = BOARD_RGHT-2;\r
        }\r
     }\r
-    if(gameInfo.variant == VariantFischeRandom) {\r
+    if(PosFlags(0) & F_FRC_TYPE_CASTLING) {
         if (WhiteOnMove(yyboardindex)) {\r
             ff = initialRights[2];\r
             ft = initialRights[0];\r