From: H.G. Muller Date: Sun, 16 Jan 2011 22:15:17 +0000 (+0100) Subject: Fix legality testing of drop moves X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=f4f7b8a380740d3b63ce4c99f222bf822f41631e;p=xboard.git Fix legality testing of drop moves Drops of noexistent pieces (i.e. with a piece indicator letter that is not corresponding to any defined piece) are now parsed as ImpossibleMove, rather than IllegalMove, so they are also rejected with legality testing off. --- diff --git a/parser.l b/parser.l index 061d6ca..7188823 100644 --- a/parser.l +++ b/parser.l @@ -845,6 +845,8 @@ extern void CopyBoard P((Board to, Board from)); } else { currentMoveString[0] = ToLower(yytext[0]); } + if(CharToPiece(currentMoveString[0]) == EmptySquare) return ImpossibleMove; // Unknown piece; + return LegalityTest(boards[yyboardindex], PosFlags(yyboardindex), DROP_RANK, // [HGM] does drops now too CharToPiece(currentMoveString[0]), currentMoveString[3] - ONE, currentMoveString[2] - AAA, NULLCHAR); }