Merge remote-tracking branch 'jimcarreer/createitem-ux' into develop

develop
lethosor 2019-11-01 23:24:10 -04:00
commit 5e1fc0700b
1 changed files with 3 additions and 1 deletions

@ -311,12 +311,14 @@ command_result df_createitem (color_ostream &out, vector <string> & parameters)
for (size_t i = 0; i < world->raws.creatures.all.size(); i++) for (size_t i = 0; i < world->raws.creatures.all.size(); i++)
{ {
string castes = "";
df::creature_raw *creature = world->raws.creatures.all[i]; df::creature_raw *creature = world->raws.creatures.all[i];
if (creature->creature_id == tokens[0]) if (creature->creature_id == tokens[0])
{ {
for (size_t j = 0; j < creature->caste.size(); j++) for (size_t j = 0; j < creature->caste.size(); j++)
{ {
df::caste_raw *caste = creature->caste[j]; df::caste_raw *caste = creature->caste[j];
castes += " "+creature->caste[j]->caste_id;
if (creature->caste[j]->caste_id == tokens[1]) if (creature->caste[j]->caste_id == tokens[1])
{ {
mat_type = i; mat_type = i;
@ -326,7 +328,7 @@ command_result df_createitem (color_ostream &out, vector <string> & parameters)
} }
if (mat_type == -1) if (mat_type == -1)
{ {
out.printerr("The creature you specified has no such caste!\n"); out.printerr("The creature you specified has no such caste!\nValid castes:%s\n", castes.c_str());
return CR_FAILURE; return CR_FAILURE;
} }
} }