From fea34bfdde2d5f5ab6e829e8f1706159fd9be02c Mon Sep 17 00:00:00 2001 From: Kelly Martin Date: Wed, 28 Mar 2012 21:57:08 -0500 Subject: [PATCH] autolabor: set reequip flag when appropriate. also tweaked scoring to reduce job clumping. --- plugins/autolabor.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/autolabor.cpp b/plugins/autolabor.cpp index 733f08066..b453da0ca 100644 --- a/plugins/autolabor.cpp +++ b/plugins/autolabor.cpp @@ -683,7 +683,7 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out ) if (labor_infos[labor].is_exclusive && dwarf_info[dwarf].has_exclusive_labor) continue; - int value = dwarf_info[dwarf].mastery_penalty - dwarf_info[dwarf].assigned_jobs; + int value = dwarf_info[dwarf].mastery_penalty - dwarf_info[dwarf].assigned_jobs * 50; if (skill != df::enums::job_skill::NONE) { @@ -796,8 +796,12 @@ DFhackCExport command_result plugin_onupdate ( color_ostream &out ) dwarfs[dwarf]->status.labors[labor] = true; - if (labor_infos[labor].is_exclusive) + if (labor_infos[labor].is_exclusive) + { dwarf_info[dwarf].has_exclusive_labor = true; + // all the exclusive labors require equipment so this should force the dorf to reequip if needed + dwarfs[dwarf]->military.pickup_flags.bits.update = 1; + } } }