mirror of https://github.com/OpenTTD/OpenTTD
(svn r21833) -Fix [FS#4427]: desync debug savegames might not be actually saved in case threading is enabled, which is enabled by default
parent
3f900d3580
commit
6a17bf91e3
|
@ -188,7 +188,7 @@ static void _GenerateWorld(void *)
|
||||||
if (_debug_desync_level > 0) {
|
if (_debug_desync_level > 0) {
|
||||||
char name[MAX_PATH];
|
char name[MAX_PATH];
|
||||||
snprintf(name, lengthof(name), "dmp_cmds_%08x_%08x.sav", _settings_game.game_creation.generation_seed, _date);
|
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 (...) {
|
} catch (...) {
|
||||||
if (_cur_company.IsValid()) _cur_company.Restore();
|
if (_cur_company.IsValid()) _cur_company.Restore();
|
||||||
|
|
|
@ -1258,7 +1258,7 @@ void StateGameLoop()
|
||||||
/* Save the desync savegame if needed. */
|
/* Save the desync savegame if needed. */
|
||||||
char name[MAX_PATH];
|
char name[MAX_PATH];
|
||||||
snprintf(name, lengthof(name), "dmp_cmds_%08x_%08x.sav", _settings_game.game_creation.generation_seed, _date);
|
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();
|
CheckCaches();
|
||||||
|
|
|
@ -2615,7 +2615,7 @@ SaveOrLoadResult LoadWithFilter(LoadFilter *reader)
|
||||||
SaveOrLoadResult SaveOrLoad(const char *filename, int mode, Subdirectory sb, bool threaded)
|
SaveOrLoadResult SaveOrLoad(const char *filename, int mode, Subdirectory sb, bool threaded)
|
||||||
{
|
{
|
||||||
/* An instance of saving is already active, so don't go saving again */
|
/* 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 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);
|
if (!_do_autosave) ShowErrorMessage(STR_ERROR_SAVE_STILL_IN_PROGRESS, INVALID_STRING_ID, WL_ERROR);
|
||||||
return SL_OK;
|
return SL_OK;
|
||||||
|
|
Loading…
Reference in New Issue