X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=304acc21cc5ea023eec943d5dcc5a81fe93856b5;hb=ca30b359aca5abcebe2590fc2c2318ff014f8130;hp=6cba81545d475c4eb0d54001d46e7fa9009d9286;hpb=414a2914d0c5fd2ac5ee27f514346716f1b892b2;p=xboard.git 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; }