From: H.G. Muller Date: Fri, 8 Jan 2010 08:21:04 +0000 (+0100) Subject: Bugfix legality null move in parsing with -testLegality off X-Git-Tag: master-20100118~19 X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=3994c15346431e4174170507360a676052456d80 Bugfix legality null move in parsing with -testLegality off The pointers were compared, in stead of the values. Furthermore, instead of null moves, it rejected moves on the main diagonal when legality checking was off. Also exclude moves with empty squares and enemy pieces. --- diff --git a/backend.c b/backend.c index 4904638..dd4b0be 100644 --- a/backend.c +++ b/backend.c @@ -4360,7 +4360,8 @@ ParseOneMove(move, moveNum, moveType, fromX, fromY, toX, toY, promoChar) if (appData.testLegality) { return (*moveType != IllegalMove); } else { - return !(fromX == fromY && toX == toY); + return !(*fromX == *toX && *fromY == *toY) && boards[moveNum][*fromY][*fromX] != EmptySquare && + WhiteOnMove(moveNum) == (boards[moveNum][*fromY][*fromX] < BlackPawn); } case WhiteDrop: