Make `createitem inspect` consistent for PLANT_GROWTH items

develop
lethosor 2020-10-09 12:45:49 -04:00
parent 9eff62a05d
commit c9609ad590
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
2 changed files with 5 additions and 1 deletions

@ -178,7 +178,7 @@ std::string ItemTypeInfo::getToken()
std::string rv = ENUM_KEY_STR(item_type, type); std::string rv = ENUM_KEY_STR(item_type, type);
if (custom) if (custom)
rv += ":" + custom->id; rv += ":" + custom->id;
else if (subtype != -1) else if (subtype != -1 && type != item_type::PLANT_GROWTH)
rv += stl_sprintf(":%d", subtype); rv += stl_sprintf(":%d", subtype);
return rv; return rv;
} }

@ -390,6 +390,10 @@ command_result df_createitem (color_ostream &out, vector <string> & parameters)
// default to empty to display a list of valid growths later // default to empty to display a list of valid growths later
tokens.push_back(""); tokens.push_back("");
} }
else if (tokens.size() == 3 && tokens[0] == "PLANT")
{
tokens.erase(tokens.begin());
}
else if (tokens.size() != 2) else if (tokens.size() != 2)
{ {
out.printerr("You must specify a plant and growth ID for this item type!\n"); out.printerr("You must specify a plant and growth ID for this item type!\n");