diff options
| author | Alexander Gavrilov | 2012-01-15 12:50:53 +0400 |
|---|---|---|
| committer | Alexander Gavrilov | 2012-01-15 12:50:53 +0400 |
| commit | 8135420d87b88917b734ec448cfd4677279fead2 (patch) | |
| tree | f6d532ccd05e6016536f26914cf1bc3331221ab6 /plugins/jobutils.cpp | |
| parent | 990a69ce9b4f04b30ee9e2f5ff09caccf3d4d1fa (diff) | |
| download | dfhack-8135420d87b88917b734ec448cfd4677279fead2.tar.gz dfhack-8135420d87b88917b734ec448cfd4677279fead2.tar.bz2 dfhack-8135420d87b88917b734ec448cfd4677279fead2.tar.xz | |
Let job-material use any material in the build item selection mode.
Diffstat (limited to 'plugins/jobutils.cpp')
| -rw-r--r-- | plugins/jobutils.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/plugins/jobutils.cpp b/plugins/jobutils.cpp index 8557f010..4b89591a 100644 --- a/plugins/jobutils.cpp +++ b/plugins/jobutils.cpp @@ -123,6 +123,13 @@ static command_result job_material_in_job(Core *c, MaterialInfo &new_mat) if (!job) return CR_FAILURE; + if (!new_mat.isValid() || new_mat.type != 0) + { + c->con.printerr("New job material isn't inorganic: %s\n", + new_mat.toString().c_str()); + return CR_FAILURE; + } + MaterialInfo cur_mat(job); if (!cur_mat.isValid() || cur_mat.type != 0) @@ -241,8 +248,8 @@ static command_result job_material(Core * c, vector <string> & parameters) MaterialInfo new_mat; if (parameters.size() == 1) { - if (!new_mat.findInorganic(parameters[0])) { - c->con.printerr("Could not find inorganic material: %s\n", parameters[0].c_str()); + if (!new_mat.find(parameters[0])) { + c->con.printerr("Could not find material: %s\n", parameters[0].c_str()); return CR_WRONG_USAGE; } } |
