Do not automatically save aborted games in tourney PGN
authorH.G. Muller <h.g.muller@hccnet.nl>
Sun, 23 Dec 2012 10:26:31 +0000 (11:26 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Sat, 19 Jan 2013 22:27:21 +0000 (23:27 +0100)
When the game result is 'unfinished', we prompt for a filename rather
then using the specified saveGameFile if a tourney is in progress.

backend.c

index 34ffd0a..52e8097 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -10668,6 +10668,9 @@ GameEnds (ChessMove result, char *resultDetails, int whosays)
                    && lastSavedGame != GameCheckSum() // [HGM] save: suppress duplicates
                                                                ) {
                    if (*appData.saveGameFile != NULLCHAR) {
+                       if(result == GameUnfinished && matchMode && *appData.tourneyFile)
+                           AutoSaveGame(); // [HGM] protect tourney PGN from aborted games, and prompt for name instead
+                       else
                        SaveGameToFile(appData.saveGameFile, TRUE);
                    } else if (appData.autoSaveGames) {
                        AutoSaveGame();