From: H.G. Muller Date: Mon, 29 Mar 2010 07:57:48 +0000 (+0200) Subject: Fix rep-draw recognition X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=9fdbee6f765e42280263dc159e476b44b75e16f0;p=xboard.git Fix rep-draw recognition The refactoring had broken the rep-draw recognition, by adding and extra condition in a conditional with side effects. The testing of this extra condition is now moved to after the side effect. --- diff --git a/backend.c b/backend.c index 36b6dd3..7672207 100644 --- a/backend.c +++ b/backend.c @@ -6772,7 +6772,7 @@ Adjudicate(ChessProgramState *cps) || NrWN==2 || NrBN==2 /* KNNK */ || NrWN+NrWB == 1 && NrBN+NrBB == 1 /* KBKN, KBKB, KNKN */ ) ) { - if(canAdjudicate && --moveCount < 0 && appData.trivialDraws) + if(--moveCount < 0 && appData.trivialDraws && canAdjudicate) { /* if the first 3 moves do not show a tactical win, declare draw */ if(engineOpponent) { SendToProgram("force\n", engineOpponent); // suppress reply @@ -6823,7 +6823,7 @@ Adjudicate(ChessProgramState *cps) boards[forwardMostMove][CASTLING][4] != boards[k][CASTLING][4] ) rights++; } - if( canAdjudicate && rights == 0 && ++count > appData.drawRepeats-2 + if( rights == 0 && ++count > appData.drawRepeats-2 && canAdjudicate && appData.drawRepeats > 1) { /* adjudicate after user-specified nr of repeats */ if(engineOpponent) {