From 3994c15346431e4174170507360a676052456d80 Mon Sep 17 00:00:00 2001 From: "H.G. Muller" Date: Fri, 8 Jan 2010 09:21:04 +0100 Subject: [PATCH] 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. --- backend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend.c b/backend.c index 49046388..dd4b0be4 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: -- 2.17.1