This moves SwitchClocks() back to after incrementing forwardMostMove,
so that it knows again who has the move (which was broken by the "bare" patch),
and will take the appropriate tick length.
char lastLoadGameTitle[MSG_SIZ], lastLoadPositionTitle[MSG_SIZ];
ChessMove lastLoadGameStart = (ChessMove) 0;
char lastLoadGameTitle[MSG_SIZ], lastLoadPositionTitle[MSG_SIZ];
ChessMove lastLoadGameStart = (ChessMove) 0;
ChessMove
UserMoveTest(fromX, fromY, toX, toY, promoChar, captureOwn)
int fromX, fromY, toX, toY;
ChessMove
UserMoveTest(fromX, fromY, toX, toY, promoChar, captureOwn)
int fromX, fromY, toX, toY;
- SwitchClocks();
- timeRemaining[0][forwardMostMove+1] = whiteTimeRemaining;
- timeRemaining[1][forwardMostMove+1] = blackTimeRemaining;
if (commentList[forwardMostMove+1] != NULL) {
free(commentList[forwardMostMove+1]);
commentList[forwardMostMove+1] = NULL;
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
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);
gameInfo.result = GameUnfinished;
if (gameInfo.resultDetails != NULL) {
free(gameInfo.resultDetails);