summaryrefslogtreecommitdiff
path: root/plugins/autolabor.cpp
diff options
context:
space:
mode:
authorPetr Mrázek2012-04-01 03:46:17 +0200
committerPetr Mrázek2012-04-01 03:46:17 +0200
commit2b4044f3f2996d6d13fffaefca9603f8a1348c55 (patch)
treea74ce7a021d8c1ed2e770ace82e7032dfc5c679d /plugins/autolabor.cpp
parent7ff728b6fcbff9e6e8cfe49b65d0645729e249f8 (diff)
downloaddfhack-2b4044f3f2996d6d13fffaefca9603f8a1348c55.tar.gz
dfhack-2b4044f3f2996d6d13fffaefca9603f8a1348c55.tar.bz2
dfhack-2b4044f3f2996d6d13fffaefca9603f8a1348c55.tar.xz
Tweaks!
Check map presence in autolabor and fastdwarf onupdate() functions Game state tracking in kittens plugin now respects on/off switch
Diffstat (limited to 'plugins/autolabor.cpp')
-rw-r--r--plugins/autolabor.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/autolabor.cpp b/plugins/autolabor.cpp
index 1b442fe2..963b6b41 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;