From 6a17bf91e3c436a5659fefcb0a2e156939e7a80c Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 18 Jan 2011 18:14:14 +0000 Subject: [PATCH] (svn r21833) -Fix [FS#4427]: desync debug savegames might not be actually saved in case threading is enabled, which is enabled by default --- src/genworld.cpp | 2 +- src/openttd.cpp | 2 +- src/saveload/saveload.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/genworld.cpp b/src/genworld.cpp index af42a5bcb0..b0ed4295f8 100644 --- a/src/genworld.cpp +++ b/src/genworld.cpp @@ -188,7 +188,7 @@ static void _GenerateWorld(void *) if (_debug_desync_level > 0) { char name[MAX_PATH]; snprintf(name, lengthof(name), "dmp_cmds_%08x_%08x.sav", _settings_game.game_creation.generation_seed, _date); - SaveOrLoad(name, SL_SAVE, AUTOSAVE_DIR); + SaveOrLoad(name, SL_SAVE, AUTOSAVE_DIR, false); } } catch (...) { if (_cur_company.IsValid()) _cur_company.Restore(); diff --git a/src/openttd.cpp b/src/openttd.cpp index 31f5d72351..2d9a581d67 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1258,7 +1258,7 @@ void StateGameLoop() /* Save the desync savegame if needed. */ char name[MAX_PATH]; snprintf(name, lengthof(name), "dmp_cmds_%08x_%08x.sav", _settings_game.game_creation.generation_seed, _date); - SaveOrLoad(name, SL_SAVE, AUTOSAVE_DIR); + SaveOrLoad(name, SL_SAVE, AUTOSAVE_DIR, false); } CheckCaches(); diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index b56fe4b2ae..f4d59ca856 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -2615,7 +2615,7 @@ SaveOrLoadResult LoadWithFilter(LoadFilter *reader) SaveOrLoadResult SaveOrLoad(const char *filename, int mode, Subdirectory sb, bool threaded) { /* An instance of saving is already active, so don't go saving again */ - if (_sl.saveinprogress && mode == SL_SAVE) { + if (_sl.saveinprogress && mode == SL_SAVE && threaded) { /* if not an autosave, but a user action, show error message */ if (!_do_autosave) ShowErrorMessage(STR_ERROR_SAVE_STILL_IN_PROGRESS, INVALID_STRING_ID, WL_ERROR); return SL_OK;