Skip to content

Commit 8135420

Browse files
committed
Let job-material use any material in the build item selection mode.
1 parent 990a69c commit 8135420

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

plugins/jobutils.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ static command_result job_material_in_job(Core *c, MaterialInfo &new_mat)
123123
if (!job)
124124
return CR_FAILURE;
125125

126+
if (!new_mat.isValid() || new_mat.type != 0)
127+
{
128+
c->con.printerr("New job material isn't inorganic: %s\n",
129+
new_mat.toString().c_str());
130+
return CR_FAILURE;
131+
}
132+
126133
MaterialInfo cur_mat(job);
127134

128135
if (!cur_mat.isValid() || cur_mat.type != 0)
@@ -241,8 +248,8 @@ static command_result job_material(Core * c, vector <string> & parameters)
241248
MaterialInfo new_mat;
242249
if (parameters.size() == 1)
243250
{
244-
if (!new_mat.findInorganic(parameters[0])) {
245-
c->con.printerr("Could not find inorganic material: %s\n", parameters[0].c_str());
251+
if (!new_mat.find(parameters[0])) {
252+
c->con.printerr("Could not find material: %s\n", parameters[0].c_str());
246253
return CR_WRONG_USAGE;
247254
}
248255
}

0 commit comments

Comments
 (0)