X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=3605468c9b17595c0055a3bf0fb15f5e701d116d;hb=de954fa0f31cc935b5ad61819a04de2713cd98ed;hp=ddd4ef203a96a7ae887e50b1c7b4a108532b0f14;hpb=c2221f8b8d4d4850075ea5c770acb51a23154b68;p=xboard.git diff --git a/backend.c b/backend.c index ddd4ef2..3605468 100644 --- a/backend.c +++ b/backend.c @@ -5050,7 +5050,6 @@ int lastLoadGameUseList = FALSE; char lastLoadGameTitle[MSG_SIZ], lastLoadPositionTitle[MSG_SIZ]; ChessMove lastLoadGameStart = (ChessMove) 0; - ChessMove UserMoveTest(fromX, fromY, toX, toY, promoChar, captureOwn) int fromX, fromY, toX, toY; @@ -5158,12 +5157,6 @@ UserMoveTest(fromX, fromY, toX, toY, promoChar, captureOwn) 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; } @@ -5185,12 +5178,6 @@ UserMoveTest(fromX, fromY, toX, toY, promoChar, captureOwn) 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; } @@ -7487,9 +7474,6 @@ MakeMove(fromX, fromY, toX, toY, promoChar) 0, 1); return; } - SwitchClocks(); - timeRemaining[0][forwardMostMove+1] = whiteTimeRemaining; - timeRemaining[1][forwardMostMove+1] = blackTimeRemaining; if (commentList[forwardMostMove+1] != NULL) { free(commentList[forwardMostMove+1]); commentList[forwardMostMove+1] = NULL; @@ -7499,6 +7483,9 @@ MakeMove(fromX, fromY, toX, toY, promoChar) ApplyMove(fromX, fromY, toX, toY, promoChar, boards[forwardMostMove+1], castlingRights[forwardMostMove+1], &epStatus[forwardMostMove+1]); forwardMostMove++; // [HGM] bare: moved to after ApplyMove, to make sure clock interrupt finds complete board + SwitchClocks(); // uses forwardMostMove, so must be done after incrementing it ! + timeRemaining[0][forwardMostMove] = whiteTimeRemaining; + timeRemaining[1][forwardMostMove] = blackTimeRemaining; gameInfo.result = GameUnfinished; if (gameInfo.resultDetails != NULL) { free(gameInfo.resultDetails);