From c9609ad5902ef8b306809fa733ea32fbe5b523a9 Mon Sep 17 00:00:00 2001 From: lethosor Date: Fri, 9 Oct 2020 12:45:49 -0400 Subject: [PATCH] Make `createitem inspect` consistent for PLANT_GROWTH items --- library/modules/Items.cpp | 2 +- plugins/createitem.cpp | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/library/modules/Items.cpp b/library/modules/Items.cpp index 3d35edb29..3bc468d04 100644 --- a/library/modules/Items.cpp +++ b/library/modules/Items.cpp @@ -178,7 +178,7 @@ std::string ItemTypeInfo::getToken() std::string rv = ENUM_KEY_STR(item_type, type); if (custom) rv += ":" + custom->id; - else if (subtype != -1) + else if (subtype != -1 && type != item_type::PLANT_GROWTH) rv += stl_sprintf(":%d", subtype); return rv; } diff --git a/plugins/createitem.cpp b/plugins/createitem.cpp index f32c51c03..ad80cff64 100644 --- a/plugins/createitem.cpp +++ b/plugins/createitem.cpp @@ -390,6 +390,10 @@ command_result df_createitem (color_ostream &out, vector & parameters) // default to empty to display a list of valid growths later tokens.push_back(""); } + else if (tokens.size() == 3 && tokens[0] == "PLANT") + { + tokens.erase(tokens.begin()); + } else if (tokens.size() != 2) { out.printerr("You must specify a plant and growth ID for this item type!\n");