diff --git a/plugins/autolabor.cpp b/plugins/autolabor.cpp index 1b442fe2f..963b6b417 100644 --- a/plugins/autolabor.cpp +++ b/plugins/autolabor.cpp @@ -29,7 +29,7 @@ using df::global::world; #define ARRAY_COUNT(array) (sizeof(array)/sizeof((array)[0])) -static int enable_autolabor; +static int enable_autolabor = 0; // Here go all the command declarations... @@ -467,9 +467,12 @@ struct values_sorter DFhackCExport command_result plugin_onupdate ( color_ostream &out ) { static int step_count = 0; - - if (!enable_autolabor) - return CR_OK; + // check run conditions + if(!world->map.block_index || !enable_autolabor) + { + // give up if we shouldn't be running' + return CR_OK; + } if (++step_count < 60) return CR_OK; diff --git a/plugins/devel/kittens.cpp b/plugins/devel/kittens.cpp index 5dbadcc72..2e8e6eaba 100644 --- a/plugins/devel/kittens.cpp +++ b/plugins/devel/kittens.cpp @@ -62,6 +62,8 @@ DFhackCExport command_result plugin_shutdown ( color_ostream &out ) DFhackCExport command_result plugin_onstatechange(color_ostream &out, state_change_event event) { + if(!statetrack) + return CR_OK; switch (event) { case SC_MAP_LOADED: out << "Map loaded" << endl; diff --git a/plugins/fastdwarf.cpp b/plugins/fastdwarf.cpp index 87402e428..643a097c4 100644 --- a/plugins/fastdwarf.cpp +++ b/plugins/fastdwarf.cpp @@ -23,12 +23,16 @@ DFhackCExport command_result plugin_shutdown ( color_ostream &out ) return CR_OK; } -static int enable_fastdwarf; +static int enable_fastdwarf = false; DFhackCExport command_result plugin_onupdate ( color_ostream &out ) { - if (!enable_fastdwarf) + // check run conditions + if(!world->map.block_index || !enable_fastdwarf) + { + // give up if we shouldn't be running' return CR_OK; + } int32_t race = ui->race_id; int32_t civ = ui->civ_id;