From 12e75643af3610ccb6b4cb8666f8810e63a98eaf Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 9 Apr 2010 16:01:48 +0000 Subject: (svn r19592) -Fix: don't do the desync debug savegames mid-StateGameLoop; they're increadibly useless (or hard to load correctly) in that case --- src/date.cpp | 6 ------ src/openttd.cpp | 7 +++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/date.cpp b/src/date.cpp index 9122b21c8..944e40bc4 100644 --- a/src/date.cpp +++ b/src/date.cpp @@ -218,12 +218,6 @@ static void OnNewYear() */ static void OnNewMonth() { - if (_debug_desync_level > 2) { - 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); - } - if (_settings_client.gui.autosave != 0 && (_cur_month % _autosave_months[_settings_client.gui.autosave]) == 0) { _do_autosave = true; RedrawAutosave(); diff --git a/src/openttd.cpp b/src/openttd.cpp index 77677dd33..86d239819 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -1206,6 +1206,13 @@ void StateGameLoop() } else { CheckCaches(); + if (_debug_desync_level > 2 && _date_fract == 0 && (_date & 0x1F) == 0) { + /* 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); + } + /* All these actions has to be done from OWNER_NONE * for multiplayer compatibility */ CompanyID old_company = _current_company; -- cgit v1.2.3-70-g09d2