From 808afca9f01553888e82cec1ec69b25534a36fd8 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Tue, 5 Jul 2016 13:16:34 -0500 Subject: [PATCH] labormanager: add StoreItemInLocation labor, reduce tool churn Note: this commit requires updated df-structures (77968973b28d0e828f880d119a700abb079f3521 or later) --- plugins/devel/labormanager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/devel/labormanager.cpp b/plugins/devel/labormanager.cpp index 545ca7f1c..98b7f0f6f 100644 --- a/plugins/devel/labormanager.cpp +++ b/plugins/devel/labormanager.cpp @@ -1359,6 +1359,8 @@ public: job_to_labor_table[df::job_type::MakeEarring] = jlf_make_object; job_to_labor_table[df::job_type::MakeBracelet] = jlf_make_object; job_to_labor_table[df::job_type::MakeGem] = jlf_make_object; + + job_to_labor_table[df::job_type::StoreItemInLocation] = jlf_no_labor; // StoreItemInLocation }; df::unit_labor find_job_labor(df::job* j) @@ -1380,7 +1382,7 @@ public: df::unit_labor labor; if (job_to_labor_table.count(j->job_type) == 0) { - debug("LABORMANAGER: job has no job to labor table entry: %s\n", ENUM_KEY_STR(job_type, j->job_type).c_str()); + debug("LABORMANAGER: job has no job to labor table entry: %s (%d)\n", ENUM_KEY_STR(job_type, j->job_type).c_str(), j->job_type); debug_pause(); labor = df::unit_labor::NONE; } else { @@ -2526,7 +2528,7 @@ public: ENUM_KEY_STR(unit_labor, l).c_str(), score, ENUM_KEY_STR(unit_labor, (*d)->using_labor).c_str(), current_score); } - if ((*d)->using_labor != df::unit_labor::NONE && score > current_score + 5000) + if ((*d)->using_labor != df::unit_labor::NONE && score > current_score + 5000 && default_labor_infos[(*d)->using_labor].tool == TOOL_NONE) set_labor(*d, (*d)->using_labor, false); } }