Let job-material use any material in the build item selection mode.

develop
Alexander Gavrilov 2012-01-15 12:50:53 +04:00
parent 990a69ce9b
commit 8135420d87
1 changed files with 9 additions and 2 deletions

@ -123,6 +123,13 @@ static command_result job_material_in_job(Core *c, MaterialInfo &new_mat)
if (!job) if (!job)
return CR_FAILURE; 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); MaterialInfo cur_mat(job);
if (!cur_mat.isValid() || cur_mat.type != 0) 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; MaterialInfo new_mat;
if (parameters.size() == 1) if (parameters.size() == 1)
{ {
if (!new_mat.findInorganic(parameters[0])) { if (!new_mat.find(parameters[0])) {
c->con.printerr("Could not find inorganic material: %s\n", parameters[0].c_str()); c->con.printerr("Could not find material: %s\n", parameters[0].c_str());
return CR_WRONG_USAGE; return CR_WRONG_USAGE;
} }
} }