minor: return CR_WRONG_USAGE if user forgot to specify material and/or quality

develop
Robert Heinrich 2012-03-29 18:26:10 +02:00
parent 836d8de73e
commit a4995d7681
1 changed files with 2 additions and 0 deletions

@ -146,6 +146,7 @@ command_result df_changeitem(color_ostream &out, vector <string> & parameters)
if(i == parameters.size()-1)
{
out.printerr("no material specified!\n");
return CR_WRONG_USAGE;
}
change_material = true;
new_material = parameters[i+1];
@ -157,6 +158,7 @@ command_result df_changeitem(color_ostream &out, vector <string> & parameters)
if(i == parameters.size()-1)
{
out.printerr("no quality specified!\n");
return CR_WRONG_USAGE;
}
string & q = parameters[i+1];
// meh. should use a stringstream instead. but it's only 6 numbers