From: H.G. Muller Date: Fri, 2 Oct 2009 23:48:03 +0000 (-0700) Subject: worked on premove bug X-Git-Tag: v4.4.1.20091019~60 X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=d016fb202fe45795e630e22ba516e754cf694ea6;p=xboard.git worked on premove bug I made an attempt to make premove unsensitive to a race condition, just in case the premove problem was caused by that (which seems unlikely, but in any case I added some deug printout to test this). --- diff --git a/backend.c b/backend.c index 6cba815..304acc2 100644 --- a/backend.c +++ b/backend.c @@ -5158,6 +5158,12 @@ UserMoveTest(fromX, fromY, toX, toY, promoChar) fprintf(debugFP, "Got premove: fromX %d," "fromY %d, toX %d, toY %d\n", fromX, fromY, toX, toY); + if(!WhiteOnMove(currentMove) && gotPremove == 1) { + // [HGM] race: we must have been hit by an opponent move from the ICS while preparing the premove + if (appData.debugMode) + fprintf(debugFP, "Execute as normal move\n"); + gotPremove = 0; break; + } } return ImpossibleMove; } @@ -5179,6 +5185,12 @@ UserMoveTest(fromX, fromY, toX, toY, promoChar) fprintf(debugFP, "Got premove: fromX %d," "fromY %d, toX %d, toY %d\n", fromX, fromY, toX, toY); + if(WhiteOnMove(currentMove) && gotPremove == 1) { + // [HGM] race: we must have been hit by an opponent move from the ICS while preparing the premove + if (appData.debugMode) + fprintf(debugFP, "Execute as normal move\n"); + gotPremove = 0; break; + } } return ImpossibleMove; }