X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=backend.c;h=42d9d197616c0566c7c073f9d9d22ee9984ffe52;hb=485413c12eae2b04aa319089a276a20155aabcb0;hp=f61c15c75a00d5d0c0787f23821af2e3053fc927;hpb=a86dd9a7d5a89677bb2aca425b519e9829dff7b4;p=xboard.git diff --git a/backend.c b/backend.c index f61c15c..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 @@ -10745,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);