diff --git a/docs/changelog.txt b/docs/changelog.txt index c54d929a9..813dbbb2e 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -43,6 +43,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: -@ `automelt`: fixed bug related to lua stack smashing behavior in returned stockpile configs -@ `autochop`: fixed bug related to lua stack smashing behavior in returned stockpile configs - `nestboxes`: now cancels any in-progress hauling jobs when it protects a fertile egg +- Fix persisted data not being written on manual save ## Misc Improvements - `automelt`: is now more resistent to savegame corruption diff --git a/library/Core.cpp b/library/Core.cpp index da560e17d..5375daa3c 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -146,6 +146,7 @@ struct Core::Private std::thread hotkeythread; bool last_autosave_request{false}; + bool last_manual_save_request{false}; bool was_load_save{false}; }; @@ -1847,7 +1848,8 @@ void Core::doUpdate(color_ostream &out) strict_virtual_cast(screen); // save data (do this before updating last_world_data_ptr and triggering unload events) - if ((df::global::plotinfo->main.autosave_request && !d->last_autosave_request) || + if ((df::global::game->main_interface.options.do_manual_save && !d->last_manual_save_request) || + (df::global::plotinfo->main.autosave_request && !d->last_autosave_request) || (is_load_save && !d->was_load_save && strict_virtual_cast(screen))) { doSaveData(out); @@ -1910,6 +1912,7 @@ void Core::doUpdate(color_ostream &out) onUpdate(out); d->last_autosave_request = df::global::plotinfo->main.autosave_request; + d->last_manual_save_request = df::global::game->main_interface.options.do_manual_save; d->was_load_save = is_load_save; out << std::flush;