if(buf_len >= 5 && buf[buf_len-5]=='\n' && buf[buf_len-4]=='\\' &&
buf[buf_len-3]==' ' && buf[buf_len-2]==' ' && buf[buf_len-1]==' ') {
buf_len -= 5; // [HGM] ICS: join continuation line of Lasker 2.2.3 server with previous
- buf[buf_len++] = ' '; // replace by space (assumes ICS does not break lines within word)
+ if(buf_len == 0 || buf[buf_len-1] != ' ')
+ buf[buf_len++] = ' '; // add space (assumes ICS does not break lines within word)
}
}
char lastLoadGameTitle[MSG_SIZ], lastLoadPositionTitle[MSG_SIZ];
ChessMove lastLoadGameStart = (ChessMove) 0;
-
ChessMove
UserMoveTest(fromX, fromY, toX, toY, promoChar, captureOwn)
int fromX, fromY, toX, toY;
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;
}
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;
}
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;
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);