From 675e92f350773b733ca8a1159d8cd37eaf61d35f Mon Sep 17 00:00:00 2001 From: Kelly Martin Date: Tue, 22 Jan 2013 16:34:51 -0600 Subject: [PATCH] Autolabor: add build floor grate labor, add unbuild screwpump labor, protect pump operators, do not clear labors on already busy dwarfs --- plugins/autolabor.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/autolabor.cpp b/plugins/autolabor.cpp index 975ac1942..15e390b22 100644 --- a/plugins/autolabor.cpp +++ b/plugins/autolabor.cpp @@ -810,6 +810,7 @@ private: case df::building_type::TractionBench: case df::building_type::Slab: case df::building_type::Chain: + case df::building_type::GrateFloor: return df::unit_labor::HAUL_FURNITURE; case df::building_type::Trap: case df::building_type::GearAssembly: @@ -853,6 +854,7 @@ private: case df::building_type::Construction: case df::building_type::Wagon: case df::building_type::Bridge: + case df::building_type::ScrewPump: { df::building_actual* b = (df::building_actual*) bld; return construction_build_labor(b->contained_items[0]->item); @@ -2178,7 +2180,10 @@ public: } int score = skill_level * 1000 - (d->high_skill - skill_level) * 2000 + (xp / (skill_level + 5) * 10); if (d->dwarf->status.labors[labor]) - score += 500; + if (labor == df::unit_labor::OPERATE_PUMP) + score += 50000; + else + score += 1000; if (default_labor_infos[labor].tool != TOOL_NONE && d->has_tool[default_labor_infos[labor].tool]) score += 5000; @@ -2219,7 +2224,7 @@ public: (*bestdwarf)->dwarf->military.pickup_flags.bits.update = true; } } - else + else if ((*bestdwarf)->state == IDLE) (*bestdwarf)->clear_labor(l); }