diff options
Diffstat (limited to 'crawl-ref/source/command.cc')
-rw-r--r-- | crawl-ref/source/command.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index 49241aea20..94eafa6827 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -21,6 +21,7 @@ #include "chardump.h" #include "cio.h" #include "database.h" +#include "debug.h" #include "describe.h" #include "files.h" #include "initfile.h" @@ -1191,6 +1192,28 @@ static bool _do_description(std::string key, std::string footer = "") suffix += getLongDescription(symbol_suffix + "_lookup"); quote += getQuoteString(symbol_suffix); } + else + { + int thing_created = get_item_slot(); + if (thing_created != NON_ITEM) + { + char name[80]; + snprintf(name, 80, key.c_str()); + if (get_item_by_name(&mitm[thing_created], name, OBJ_WEAPONS)) + { + append_weapon_stats(desc, mitm[thing_created]); + desc += "$"; + } + else if (get_item_by_name(&mitm[thing_created], name, OBJ_ARMOUR)) + { + append_armour_stats(desc, mitm[thing_created]); + desc += "$"; + } + + // Now we don't need the item anymore. + destroy_item(thing_created); + } + } } key = uppercase_first(key); |