From: H.G. Muller Date: Wed, 6 Jan 2010 23:17:25 +0000 (+0100) Subject: Implement castling in -variant caparandom X-Git-Tag: master-20100118~27 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=0cba5b3ac1360105f1ac24aba3c848adfa87f009;p=xboard.git Implement castling in -variant caparandom CRC should be treated as FRC, but until now it never was. We now test for FRC_TYPE_CASTLING. --- 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];