From 0cba5b3ac1360105f1ac24aba3c848adfa87f009 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Thu, 7 Jan 2010 00:17:25 +0100 Subject: [PATCH] Implement castling in -variant caparandom CRC should be treated as FRC, but until now it never was. We now test for FRC_TYPE_CASTLING. --- moves.c | 2 +- parser.l | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/moves.c b/moves.c index 12f9b63..663660c 100644 --- a/moves.c +++ b/moves.c @@ -855,7 +855,7 @@ int GenLegal(board, flags, 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 7dda43f..76ec89d 100644 --- a/parser.l +++ b/parser.l @@ -686,7 +686,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]; @@ -741,7 +741,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