Skip to content

Commit

Permalink
Autolabor: add build floor grate labor, add unbuild screwpump labor, …
Browse files Browse the repository at this point in the history
…protect pump operators, do not clear labors on already busy dwarfs
  • Loading branch information
ab9rf committed Jan 22, 2013
1 parent 90a62a8 commit 675e92f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions plugins/autolabor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,7 @@ class JobLaborMapper {
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:
Expand Down Expand Up @@ -853,6 +854,7 @@ class JobLaborMapper {
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);
Expand Down Expand Up @@ -2178,7 +2180,10 @@ class AutoLaborManager {
}
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;
Expand Down Expand Up @@ -2219,7 +2224,7 @@ class AutoLaborManager {
(*bestdwarf)->dwarf->military.pickup_flags.bits.update = true;
}
}
else
else if ((*bestdwarf)->state == IDLE)
(*bestdwarf)->clear_labor(l);
}

Expand Down

0 comments on commit 675e92f

Please sign in to comment.