From 8135420d87b88917b734ec448cfd4677279fead2 Mon Sep 17 00:00:00 2001 From: Alexander Gavrilov Date: Sun, 15 Jan 2012 12:50:53 +0400 Subject: [PATCH] Let job-material use any material in the build item selection mode. --- plugins/jobutils.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/jobutils.cpp b/plugins/jobutils.cpp index 8557f0102..4b89591a4 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 & 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; } }