From c591aa5f691ddd2fe00a64993e006d105b47f4a3 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Wed, 2 Jul 2014 14:34:53 +0200 Subject: [PATCH] Fix typing of null moves Entering a null move through the move type-in could fail because the to-square coordinates (not used in its encoding) could have invalid values, which would reject the move in an early stage of UserMoveEvent(). Null moves are now exempted from this vaidity test, while variants where null moves are legal now accept them in any gameMode. --- backend.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend.c b/backend.c index b269bf3..f05359c 100644 --- a/backend.c +++ b/backend.c @@ -6972,7 +6972,7 @@ UserMoveEvent(int fromX, int fromY, int toX, int toY, int promoChar) return; } - if(toX < 0 || toY < 0) return; + if((toX < 0 || toY < 0) && (fromY != DROP_RANK || fromX != EmptySquare)) return; pup = boards[currentMove][toY][toX]; /* [HGM] If move started in holdings, it means a drop. Convert to standard form */ @@ -6992,7 +6992,7 @@ UserMoveEvent(int fromX, int fromY, int toX, int toY, int promoChar) moveType = LegalityTest(boards[currentMove], PosFlags(currentMove), fromY, fromX, toY, toX, promoChar); - if(fromY == DROP_RANK && fromX == EmptySquare && (gameMode == AnalyzeMode || gameMode == EditGame)) moveType = NormalMove; + if(fromY == DROP_RANK && fromX == EmptySquare && (gameMode == AnalyzeMode || gameMode == EditGame || PosFlags(0) & F_NULL_MOVE)) moveType = NormalMove; /* [HGM] but possibly ignore an IllegalMove result */ if (appData.testLegality) { -- 1.7.0.4