Autolabor: only care about skills that are used for labors, when determining a dwarf's highest skill.

develop
Kelly Martin 2012-12-07 15:41:39 -06:00
parent fa9b71adc5
commit 42670f0233
1 changed files with 7 additions and 3 deletions

@ -1751,11 +1751,15 @@ private:
int high_skill = 0; int high_skill = 0;
FOR_ENUM_ITEMS (job_skill, skill) FOR_ENUM_ITEMS (unit_labor, labor)
{
df::job_skill skill = labor_to_skill[labor];
if (skill != df::job_skill::NONE)
{ {
int skill_level = Units::getNominalSkill(dwarf->dwarf, skill, false); int skill_level = Units::getNominalSkill(dwarf->dwarf, skill, false);
high_skill = std::max(high_skill, skill_level); high_skill = std::max(high_skill, skill_level);
} }
}
dwarf->high_skill = high_skill; dwarf->high_skill = high_skill;
// check if dwarf has an axe, pick, or crossbow // check if dwarf has an axe, pick, or crossbow