diff --git a/plugins/autobutcher.cpp b/plugins/autobutcher.cpp index 37ab0b587e..a91288be32 100644 --- a/plugins/autobutcher.cpp +++ b/plugins/autobutcher.cpp @@ -79,7 +79,7 @@ DFhackCExport command_result plugin_init(color_ostream &out, vector ¶meters) { CoreSuspender suspend; - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } diff --git a/plugins/autochop.cpp b/plugins/autochop.cpp index 80307700d6..642da55a41 100644 --- a/plugins/autochop.cpp +++ b/plugins/autochop.cpp @@ -121,7 +121,7 @@ DFhackCExport command_result plugin_init(color_ostream &out, std::vector ¶meters) { CoreSuspender suspend; - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } diff --git a/plugins/autoclothing.cpp b/plugins/autoclothing.cpp index 673d88ee6a..877e65db38 100644 --- a/plugins/autoclothing.cpp +++ b/plugins/autoclothing.cpp @@ -298,7 +298,7 @@ DFhackCExport command_result plugin_save_site_data (color_ostream &out) } DFhackCExport command_result plugin_enable(color_ostream& out, bool enable) { - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot enable %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } @@ -441,7 +441,7 @@ command_result autoclothing(color_ostream &out, vector & parameters) // be sure to suspend the core if any DF state is read or modified CoreSuspender suspend; - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } diff --git a/plugins/autofarm.cpp b/plugins/autofarm.cpp index 64845047d5..7e80aee47b 100644 --- a/plugins/autofarm.cpp +++ b/plugins/autofarm.cpp @@ -452,7 +452,7 @@ DFhackCExport command_result plugin_onupdate(color_ostream& out) DFhackCExport command_result plugin_enable(color_ostream& out, bool enable) { - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot enable %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } @@ -511,7 +511,7 @@ static command_result setThresholds(color_ostream& out, std::vector static command_result autofarm(color_ostream& out, std::vector& parameters) { - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } diff --git a/plugins/autolabor/autolabor.cpp b/plugins/autolabor/autolabor.cpp index ed18526269..b3c8e070bb 100644 --- a/plugins/autolabor/autolabor.cpp +++ b/plugins/autolabor/autolabor.cpp @@ -1072,7 +1072,7 @@ void print_labor (df::unit_labor labor, color_ostream &out) DFhackCExport command_result plugin_enable ( color_ostream &out, bool enable ) { - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot enable %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } @@ -1093,7 +1093,7 @@ command_result autolabor (color_ostream &out, std::vector & parame { CoreSuspender suspend; - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } diff --git a/plugins/autonestbox.cpp b/plugins/autonestbox.cpp index 564fbfaf00..e2c1876518 100644 --- a/plugins/autonestbox.cpp +++ b/plugins/autonestbox.cpp @@ -61,7 +61,7 @@ DFhackCExport command_result plugin_init(color_ostream &out, std::vector ¶meters) { CoreSuspender suspend; - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } diff --git a/plugins/autoslab.cpp b/plugins/autoslab.cpp index ca722a873b..bf7fff0a5c 100644 --- a/plugins/autoslab.cpp +++ b/plugins/autoslab.cpp @@ -61,7 +61,7 @@ DFhackCExport command_result plugin_init(color_ostream &out, std::vector ¶meters) { CoreSuspender suspend; - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot configure %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } @@ -756,7 +756,7 @@ static int countAvailableItems(color_ostream &out, df::building_type type, int16 static bool hasFilter(color_ostream &out, df::building_type type, int16_t subtype, int32_t custom, int index) { TRACE(control,out).print("entering hasFilter\n"); - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) return false; BuildingTypeKey key(type, subtype, custom); auto &filters = get_item_filters(out, key); diff --git a/plugins/burrow.cpp b/plugins/burrow.cpp index 3b41ed7430..8de149979d 100644 --- a/plugins/burrow.cpp +++ b/plugins/burrow.cpp @@ -91,7 +91,7 @@ DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_chan static command_result do_command(color_ostream &out, vector ¶meters) { CoreSuspender suspend; - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } @@ -112,7 +112,7 @@ static command_result do_command(color_ostream &out, vector ¶meters) // static void init_diggers(color_ostream& out) { - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { DEBUG(status, out).print("map not yet loaded; not scanning jobs\n"); return; } diff --git a/plugins/dwarfvet.cpp b/plugins/dwarfvet.cpp index 8e1901facd..c8fbf69599 100644 --- a/plugins/dwarfvet.cpp +++ b/plugins/dwarfvet.cpp @@ -67,7 +67,7 @@ DFhackCExport command_result plugin_init(color_ostream &out, vector ¶meters) { CoreSuspender suspend; - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } diff --git a/plugins/logistics.cpp b/plugins/logistics.cpp index 44e9b83f25..b671739bed 100644 --- a/plugins/logistics.cpp +++ b/plugins/logistics.cpp @@ -178,7 +178,7 @@ DFhackCExport command_result plugin_load_site_data(color_ostream &out) { } DFhackCExport command_result plugin_onupdate(color_ostream &out) { - if (!is_enabled || !Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) + if (!is_enabled || !Core::getInstance().isMapLoaded() || !World::isFortressMode()) return CR_OK; if (world->frame_counter - cycle_timestamp >= CYCLE_TICKS) { int32_t melt_count = 0, trade_count = 0, dump_count = 0, train_count = 0; @@ -198,7 +198,7 @@ DFhackCExport command_result plugin_onupdate(color_ostream &out) { static command_result do_command(color_ostream &out, vector ¶meters) { CoreSuspender suspend; - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } diff --git a/plugins/misery.cpp b/plugins/misery.cpp index a2c31e8a14..3c7ce0598c 100644 --- a/plugins/misery.cpp +++ b/plugins/misery.cpp @@ -60,7 +60,7 @@ DFhackCExport command_result plugin_init(color_ostream &out, std::vector ¶meters) { CoreSuspender suspend; - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } diff --git a/plugins/nestboxes.cpp b/plugins/nestboxes.cpp index 9d8a65de90..c5afce8099 100644 --- a/plugins/nestboxes.cpp +++ b/plugins/nestboxes.cpp @@ -47,7 +47,7 @@ DFhackCExport command_result plugin_init(color_ostream &out, std::vector & parameters) { CoreSuspender suspend; - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } @@ -166,7 +166,7 @@ DFhackCExport command_result plugin_init(color_ostream &out, vector& params) { - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot use %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } @@ -88,7 +88,7 @@ static command_result do_command(color_ostream& out, std::vector& p EventManager::EventHandler assign_tomb_handler(plugin_self, onUnitDeath, 0); DFhackCExport command_result plugin_enable(color_ostream &out, bool enable) { - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot enable %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } diff --git a/plugins/seedwatch.cpp b/plugins/seedwatch.cpp index d8ed81d65d..01bce59499 100644 --- a/plugins/seedwatch.cpp +++ b/plugins/seedwatch.cpp @@ -142,7 +142,7 @@ DFhackCExport command_result plugin_init(color_ostream &out, std::vector ¶meters) { CoreSuspender suspend; - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } diff --git a/plugins/spectate/spectate.cpp b/plugins/spectate/spectate.cpp index a437cbfc09..61584e8258 100644 --- a/plugins/spectate/spectate.cpp +++ b/plugins/spectate/spectate.cpp @@ -392,7 +392,7 @@ DFhackCExport command_result plugin_load_site_data (color_ostream &out) { } DFhackCExport command_result plugin_enable(color_ostream &out, bool enable) { - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } @@ -433,7 +433,7 @@ DFhackCExport command_result plugin_onupdate(color_ostream &out) { } command_result spectate (color_ostream &out, std::vector & parameters) { - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } diff --git a/plugins/suspendmanager.cpp b/plugins/suspendmanager.cpp index 59353fdeee..7cd57ca568 100644 --- a/plugins/suspendmanager.cpp +++ b/plugins/suspendmanager.cpp @@ -777,7 +777,7 @@ DFhackCExport command_result plugin_init(color_ostream &out, std::vector ¶meters) // be sure to suspend the core if any DF state is read or modified CoreSuspender suspend; - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } diff --git a/plugins/tailor.cpp b/plugins/tailor.cpp index 3f5a6cb9c2..b17ecb0fdf 100644 --- a/plugins/tailor.cpp +++ b/plugins/tailor.cpp @@ -633,7 +633,7 @@ DFhackCExport command_result plugin_init(color_ostream &out, std::vector ¶meters) { CoreSuspender suspend; - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } diff --git a/plugins/work-now.cpp b/plugins/work-now.cpp index 6e56d49ad4..afba91af56 100644 --- a/plugins/work-now.cpp +++ b/plugins/work-now.cpp @@ -45,7 +45,7 @@ static void cleanup() { } DFhackCExport command_result plugin_enable(color_ostream &out, bool enable) { - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot enable %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } @@ -110,7 +110,7 @@ DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_chan } static command_result work_now(color_ostream& out, vector& parameters) { - if (!Core::getInstance().isMapLoaded() || !World::IsSiteLoaded()) { + if (!Core::getInstance().isMapLoaded() || !World::isFortressMode()) { out.printerr("Cannot run %s without a loaded fort.\n", plugin_name); return CR_FAILURE; } diff --git a/scripts b/scripts index 0d7bfa31b5..986647318d 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit 0d7bfa31b5b5e2e289433f9d1ef9099ee4ec461c +Subproject commit 986647318d979e48535bd39373751267e063e5f2