From 3b9f21a1eac3c3a0a1c1f00bab6f6e1406d28b99 Mon Sep 17 00:00:00 2001 From: Kelly Martin Date: Wed, 12 Dec 2012 10:37:09 -0600 Subject: [PATCH] Autolabor: do not count designations in hidden squares (since your dwarves can't reach them anyway). Also apply an assignment penalty for assigning a dwarf to a labor other than the one the dwarf is doing --- plugins/autolabor.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/autolabor.cpp b/plugins/autolabor.cpp index 266a2771d..fc8559df0 100644 --- a/plugins/autolabor.cpp +++ b/plugins/autolabor.cpp @@ -1540,6 +1540,9 @@ private: for (int x = 0; x < 16; x++) for (int y = 0; y < 16; y++) { + if (bl->designation[x][y].bits.hidden) + continue; + df::tile_dig_designation dig = bl->designation[x][y].bits.dig; if (dig != df::enums::tile_dig_designation::No) { @@ -2094,8 +2097,11 @@ public: score -= 10000; if (d->armed && labor_outside[labor]) score += 5000; - if (d->state == BUSY && d->using_labor == labor) - score += 7500; + if (d->state == BUSY) + if (d->using_labor == labor) + score += 7500; + else + score -= 7500; if (score > best_score) { bestdwarf = k;