From 9fdbee6f765e42280263dc159e476b44b75e16f0 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 29 Mar 2010 09:57:48 +0200 Subject: [PATCH] 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. --- backend.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 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) { -- 1.7.0.4