diff options
| author | Alexander Gavrilov | 2012-01-10 17:23:37 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-01-10 17:23:37 +0400 |
| commit | 7f5aa4de62931d7c5dad2630103803d7ec14e208 (patch) | |
| tree | bb7f082af2fe98b76af9ad38d716ada15295c00a /plugins/jobutils.cpp | |
| parent | 571498ea2100ae84b360c1ef54f727404be20986 (diff) | |
| download | dfhack-7f5aa4de62931d7c5dad2630103803d7ec14e208.tar.gz dfhack-7f5aa4de62931d7c5dad2630103803d7ec14e208.tar.bz2 dfhack-7f5aa4de62931d7c5dad2630103803d7ec14e208.tar.xz | |
Support the most important job types in workflow.
Diffstat (limited to 'plugins/jobutils.cpp')
| -rw-r--r-- | plugins/jobutils.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/jobutils.cpp b/plugins/jobutils.cpp index 29d86230..8557f010 100644 --- a/plugins/jobutils.cpp +++ b/plugins/jobutils.cpp @@ -268,7 +268,10 @@ static command_result job_duplicate(Core * c, vector <string> & parameters) if (!job) return CR_FAILURE; - if (!job->misc_links.empty() || job->job_items.empty()) + if (!job->misc_links.empty() || + (job->job_items.empty() && + job->job_type != job_type::CollectSand && + job->job_type != job_type::CollectClay)) { c->con.printerr("Cannot duplicate job %s\n", ENUM_KEY_STR(job_type,job->job_type)); return CR_FAILURE; @@ -343,7 +346,7 @@ static command_result job_cmd(Core * c, vector <string> & parameters) return CR_FAILURE; } - if (!iinfo.matches(*item, &minfo)) { + if (minfo.isValid() && !iinfo.matches(*item, &minfo)) { c->con.printerr("Material does not match the requirements.\n"); printJobDetails(c, job); return CR_FAILURE; @@ -387,7 +390,7 @@ static command_result job_cmd(Core * c, vector <string> & parameters) return CR_FAILURE; } - if (!iinfo.matches(*item, &minfo)) { + if (iinfo.isValid() && !iinfo.matches(*item, &minfo)) { c->con.printerr("Item type does not match the requirements.\n"); printJobDetails(c, job); return CR_FAILURE; |
