X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=42d9d197616c0566c7c073f9d9d22ee9984ffe52;hb=485413c12eae2b04aa319089a276a20155aabcb0;hp=ea569f3c0bbc3be94b4e1743095d5eda579857c6;hpb=93253eabd41368b4a4a8513fbbe37c74c0e30c1c;p=xboard.git diff --git a/backend.c b/backend.c index ea569f3..42d9d19 100644 --- a/backend.c +++ b/backend.c @@ -5492,6 +5492,8 @@ MultiPV (ChessProgramState *cps) return -1; } +Boolean extendGame; // signals to UnLoadPV() if walked part of PV has to be appended to game + Boolean LoadMultiPV (int x, int y, char *buf, int index, int *start, int *end, int pane) { @@ -5523,6 +5525,7 @@ LoadMultiPV (int x, int y, char *buf, int index, int *start, int *end, int pane) } ParsePV(buf+startPV, FALSE, gameMode != AnalyzeMode); *start = startPV; *end = index-1; + extendGame = (gameMode == AnalyzeMode && appData.autoExtend); return TRUE; } @@ -5552,6 +5555,7 @@ LoadPV (int x, int y) int which = gameMode == TwoMachinesPlay && (WhiteOnMove(forwardMostMove) == (second.twoMachinesColor[0] == 'w')); lastX = x; lastY = y; ParsePV(lastPV[which], FALSE, TRUE); // load the PV of the thinking engine in the boards array. + extendGame = FALSE; return TRUE; } @@ -5562,7 +5566,7 @@ UnLoadPV () if(endPV < 0) return; if(appData.autoCopyPV) CopyFENToClipboard(); endPV = -1; - if(gameMode == AnalyzeMode && currentMove > forwardMostMove) { + if(extendGame && currentMove > forwardMostMove) { Boolean saveAnimate = appData.animate; if(pushed) { if(shiftKey && storedGames < MAX_VARIATIONS-2) { // wants to start variation, and there is space @@ -9480,6 +9484,7 @@ ApplyMove (int fromX, int fromY, int toX, int toY, int promoChar, Board board) board[toY][toX] = (ChessSquare) (PROMOTED board[toY][toX]); board[fromY][fromX] = EmptySquare; } else if ((fromY >= BOARD_HEIGHT>>1) + && (oldEP == toX || oldEP == EP_UNKNOWN || appData.testLegality) && (toX != fromX) && gameInfo.variant != VariantXiangqi && gameInfo.variant != VariantBerolina @@ -9540,6 +9545,7 @@ ApplyMove (int fromX, int fromY, int toX, int toY, int promoChar, Board board) board[toY][toX] = (ChessSquare) (PROMOTED board[toY][toX]); board[fromY][fromX] = EmptySquare; } else if ((fromY < BOARD_HEIGHT>>1) + && (oldEP == toX || oldEP == EP_UNKNOWN || appData.testLegality) && (toX != fromX) && gameInfo.variant != VariantXiangqi && gameInfo.variant != VariantBerolina @@ -10743,7 +10749,7 @@ GameEnds (ChessMove result, char *resultDetails, int whosays) else SaveGameToFile(appData.saveGameFile, TRUE); } else if (appData.autoSaveGames) { - AutoSaveGame(); + if(gameMode != IcsObserving || !appData.onlyOwn) AutoSaveGame(); } if (*appData.savePositionFile != NULLCHAR) { SavePositionToFile(appData.savePositionFile);