From c8ee374e1c882ec80a255aea279c595291b53c5b Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sun, 9 Jan 2011 00:08:52 +0100 Subject: [PATCH] Show move that causes false illegal-move claim Without claim testing XBoard takes back moves that an engine objects to. But when the engine is forfeited for a false claim, the move should of course stay. So the claim test is moved to before the take-back. --- backend.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backend.c b/backend.c index b48ea5f..8169707 100644 --- a/backend.c +++ b/backend.c @@ -7691,6 +7691,13 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats. gameMode = EditGame; ModeHighlight(); } + /* [HGM] illegal-move claim should forfeit game when Xboard */ + /* only passes fully legal moves */ + if( appData.testLegality && gameMode == TwoMachinesPlay ) { + GameEnds( cps->twoMachinesColor[0] == 'w' ? BlackWins : WhiteWins, + "False illegal-move claim", GE_XBOARD ); + return; // do not take back move we tested as valid + } currentMove = forwardMostMove-1; DisplayMove(currentMove-1); /* before DisplayMoveError */ SwitchClocks(forwardMostMove-1); // [HGM] race @@ -7699,13 +7706,6 @@ if(appData.debugMode) fprintf(debugFP, "nodes = %d, %lld\n", (int) programStats. parseList[currentMove], cps->which); DisplayMoveError(buf1); DrawPosition(FALSE, boards[currentMove]); - - /* [HGM] illegal-move claim should forfeit game when Xboard */ - /* only passes fully legal moves */ - if( appData.testLegality && gameMode == TwoMachinesPlay ) { - GameEnds( cps->twoMachinesColor[0] == 'w' ? BlackWins : WhiteWins, - "False illegal-move claim", GE_XBOARD ); - } return; } if (strncmp(message, "time", 4) == 0 && StrStr(message, "Illegal")) { -- 1.7.0.4