update autogems to respect workshop profiles

Add a test so that autogems will not assign cut gem jobs to workshops that are not allowed to do them.

Fixes #1263
develop
Kelly Kinkade 2021-08-10 06:29:10 -05:00
parent 0140ace317
commit 2981deb521
1 changed files with 6 additions and 0 deletions

@ -155,6 +155,12 @@ void create_jobs() {
continue;
}
auto profile = workshop->getWorkshopProfile();
if (profile && profile->blocked_labors[df::unit_labor::CUT_GEM]) {
// workshop profile does not allow cut gem jobs (fixes #1263)
continue;
}
if (links.size() > 0) {
for (auto l = links.begin(); l != links.end() && workshop->jobs.size() <= MAX_WORKSHOP_JOBS; ++l) {
auto stockpile = virtual_cast<df::building_stockpilest>(*l);