diff --git a/docs/changelog.txt b/docs/changelog.txt index 7acd5111f..41259ad4c 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -45,6 +45,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences: - Fixed many tools passing incorrect arguments to printf-style functions, including a few possible crashes (`changelayer`, `follow`, `forceequip`, `generated-creature-renamer`) - Fixed ``-g`` flag (GDB) in Linux ``dfhack`` script (particularly on x64) - `autochop`, `autodump`, `autogems`, `automelt`, `autotrade`, `buildingplan`, `dwarfmonitor`, `fix-unit-occupancy`, `fortplan`, `stockflow`: fix issues with periodic tasks not working for some time after save/load cycles +- `autogems`, `fix-unit-occupancy`: stopped running when a fort isn't loaded (e.g. while embarking) - `buildingplan`, `fortplan`: stop running before a world has fully loaded - `autogems`: - stop running repeatedly when paused diff --git a/plugins/autogems.cpp b/plugins/autogems.cpp index b42d5bd16..4121b562f 100644 --- a/plugins/autogems.cpp +++ b/plugins/autogems.cpp @@ -222,7 +222,8 @@ void create_jobs() { } DFhackCExport command_result plugin_onupdate(color_ostream &out) { - if (running && !World::ReadPauseState() && (world->frame_counter % DELTA_TICKS == 0)) { + if (running && !World::ReadPauseState() && Maps::IsValid() && + (world->frame_counter % DELTA_TICKS == 0)) { create_jobs(); } diff --git a/plugins/fix-unit-occupancy.cpp b/plugins/fix-unit-occupancy.cpp index b2e5d23ae..d602ae213 100644 --- a/plugins/fix-unit-occupancy.cpp +++ b/plugins/fix-unit-occupancy.cpp @@ -211,7 +211,7 @@ DFhackCExport command_result plugin_enable (color_ostream &out, bool enable) DFhackCExport command_result plugin_onupdate (color_ostream &out) { - if (is_enabled && World::isFortressMode()) + if (is_enabled && World::isFortressMode() && Maps::IsValid()) { if (world->frame_counter % run_interval == 0 && !World::ReadPauseState()) {