From f4f7b8a380740d3b63ce4c99f222bf822f41631e Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 16 Jan 2011 23:15:17 +0100 Subject: [PATCH] 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. --- parser.l | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) 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); } -- 1.7.0.4