From a32d18cbb939b240bc16d909fce71ba72c24f040 Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 23 Feb 2014 22:03:08 +0000 Subject: (svn r26371) -Fix [FS#5831]: Calling DoCommandP during the gameloop cleared pending persistent storage changes. --- src/genworld.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/genworld.cpp') diff --git a/src/genworld.cpp b/src/genworld.cpp index cb03db062..822fe141f 100644 --- a/src/genworld.cpp +++ b/src/genworld.cpp @@ -105,6 +105,8 @@ static void _GenerateWorld(void *) SetGeneratingWorldProgress(GWP_MAP_INIT, 2); SetObjectToPlace(SPR_CURSOR_ZZZ, PAL_NONE, HT_NONE, WC_MAIN_WINDOW, 0); + BasePersistentStorageArray::SwitchMode(PSM_ENTER_GAMELOOP); + IncreaseGeneratingWorldProgress(GWP_MAP_INIT); /* Must start economy early because of the costs. */ StartupEconomy(); @@ -141,8 +143,6 @@ static void _GenerateWorld(void *) } } - ClearPersistentStorageChanges(true); - /* These are probably pointless when inside the scenario editor. */ SetGeneratingWorldProgress(GWP_GAME_INIT, 3); StartupCompanies(); @@ -179,6 +179,8 @@ static void _GenerateWorld(void *) } } + BasePersistentStorageArray::SwitchMode(PSM_LEAVE_GAMELOOP); + ResetObjectToPlace(); _cur_company.Trash(); _current_company = _local_company = _gw.lc; @@ -202,6 +204,7 @@ static void _GenerateWorld(void *) SaveOrLoad(name, SL_SAVE, AUTOSAVE_DIR, false); } } catch (...) { + BasePersistentStorageArray::SwitchMode(PSM_LEAVE_GAMELOOP, true); if (_cur_company.IsValid()) _cur_company.Restore(); _generating_world = false; _modal_progress_work_mutex->EndCritical(); -- cgit v1.2.3-54-g00ecf