diff --git a/docs/changelog.txt b/docs/changelog.txt index 843d917c9f..a1c1eba1fd 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -69,6 +69,7 @@ Template for new versions: - `regrass`: ``--mud`` now converts muddy slade to grass, consistent with normal DF behavior - `gui/pathable`: fix hang when showing trade depot wagon access and a trade depot is submerged under water - `gui/pathable`: fix incorrect calculation of wagon paths over stairs and through doors +- Ensure DFHack state for the site is properly saved when retiring a fort ## Misc Improvements - `sort`: can now search for stockpiles on the Places>Stockpile tab by name, number, or enabled item categories diff --git a/library/Core.cpp b/library/Core.cpp index ccc88cb4a2..01756ef0fa 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -57,6 +57,7 @@ distribution. #include "df/interfacest.h" #include "df/plotinfost.h" #include "df/viewscreen_dwarfmodest.h" +#include "df/viewscreen_export_regionst.h" #include "df/viewscreen_game_cleanerst.h" #include "df/viewscreen_loadgamest.h" #include "df/viewscreen_new_regionst.h" @@ -1948,15 +1949,16 @@ void Core::doUpdate(color_ostream &out) vs_changed = true; } - bool is_load_save = + bool is_save = strict_virtual_cast(screen) || + strict_virtual_cast(screen); + bool is_load_save = is_save || strict_virtual_cast(screen) || - strict_virtual_cast(screen) || - strict_virtual_cast(screen); + strict_virtual_cast(screen); // save data (do this before updating last_world_data_ptr and triggering unload events) if ((df::global::game && df::global::game->main_interface.options.do_manual_save && !d->last_manual_save_request) || (df::global::plotinfo && df::global::plotinfo->main.autosave_request && !d->last_autosave_request) || - (is_load_save && !d->was_load_save && strict_virtual_cast(screen))) + (is_load_save && !d->was_load_save && is_save)) { plug_mgr->doSaveData(out); Persistence::Internal::save(out);