From 1946a408d6f14119c91e6a088c7e60b32fd552d9 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Wed, 6 Jan 2010 16:56:02 +0100 Subject: [PATCH] Implement castling for variant CRC --- moves.c | 2 +- parser.l | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/moves.c b/moves.c index 8ca57be..7835bc9 100644 --- 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 */ diff --git a/parser.l b/parser.l index d96b95a..554c5eb 100755 --- a/parser.l +++ b/parser.l @@ -698,7 +698,7 @@ extern void CopyBoard P((Board to, Board from)); ft = BOARD_LEFT+2; } } - if(gameInfo.variant == VariantFischeRandom) { + if(PosFlags(0) & F_FRC_TYPE_CASTLING) { if (WhiteOnMove(yyboardindex)) { ff = initialRights[2]; ft = initialRights[1]; @@ -755,7 +755,7 @@ extern void CopyBoard P((Board to, Board from)); ft = BOARD_RGHT-2; } } - if(gameInfo.variant == VariantFischeRandom) { + if(PosFlags(0) & F_FRC_TYPE_CASTLING) { if (WhiteOnMove(yyboardindex)) { ff = initialRights[2]; ft = initialRights[0]; -- 1.7.0.4