From: H.G. Muller Date: Sat, 8 Jan 2011 23:08:52 +0000 (+0100) Subject: Show move that causes false illegal-move claim X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=c8ee374e1c882ec80a255aea279c595291b53c5b;p=xboard.git 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. --- 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")) {