X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=parser.l;h=29a2fa944bd6f13a7dfb35ccc177fee7df73d083;hb=cf8ee83ef1cee354cad4503b242f724abac1fe68;hp=ca41c63abb90626c01bc125f6faa4176eb976f9d;hpb=5044bd45730eb785494c8a3ffc29cf05ead43068;p=xboard.git diff --git a/parser.l b/parser.l index ca41c63..29a2fa9 100755 --- a/parser.l +++ b/parser.l @@ -243,7 +243,8 @@ extern void CopyBoard P((Board to, Board from)); return (int) IllegalMove; result = LegalityTest(boards[yyboardindex], - PosFlags(yyboardindex), EP_UNKNOWN, + PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: might think we can e.p.! + EP_UNKNOWN, initialRights, /* [HGM] assume all castlings allowed */ currentMoveString[1] - ONE, currentMoveString[0] - AAA, @@ -304,7 +305,8 @@ extern void CopyBoard P((Board to, Board from)); return 0; result = LegalityTest(boards[yyboardindex], - PosFlags(yyboardindex), EP_UNKNOWN, + PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: might think we can e.p.! + EP_UNKNOWN, initialRights, /* [HGM] assume all castlings allowed */ currentMoveString[1] - ONE, currentMoveString[0] - AAA, @@ -485,7 +487,8 @@ extern void CopyBoard P((Board to, Board from)); } result = LegalityTest(boards[yyboardindex], - PosFlags(yyboardindex), EP_UNKNOWN, + PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: might think we can e.p.! + EP_UNKNOWN, initialRights, /* [HGM] assume all castlings allowed */ currentMoveString[1] - ONE, currentMoveString[0] - AAA, @@ -525,7 +528,8 @@ extern void CopyBoard P((Board to, Board from)); } result = LegalityTest(boards[yyboardindex], - PosFlags(yyboardindex), EP_UNKNOWN, + PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: might think we can e.p.! + EP_UNKNOWN, initialRights, /* [HGM] assume all castlings allowed */ currentMoveString[1] - ONE, currentMoveString[0] - AAA, @@ -706,7 +710,8 @@ extern void CopyBoard P((Board to, Board from)); fprintf(debugFP, "long castling %d %d\n", ff, ft); } return (int) LegalityTest(boards[yyboardindex], - PosFlags(yyboardindex), EP_UNKNOWN, + PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: e.p.! + EP_UNKNOWN, castlingRights[yyboardindex], /* [HGM] use true castling rights */ rf, ff, rt, ft, NULLCHAR); } @@ -762,7 +767,8 @@ extern void CopyBoard P((Board to, Board from)); } return (int) LegalityTest(boards[yyboardindex], - PosFlags(yyboardindex), EP_UNKNOWN, + PosFlags(yyboardindex)&~F_MANDATORY_CAPTURE, // [HGM] losers: e.p.! + EP_UNKNOWN, castlingRights[yyboardindex], /* [HGM] use true castling rights */ rf, ff, rt, ft, NULLCHAR); }