From d016fb202fe45795e630e22ba516e754cf694ea6 Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Fri, 2 Oct 2009 16:48:03 -0700 Subject: [PATCH] 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). --- backend.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) 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; } -- 1.7.0.4