summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/itemname.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/itemname.cc')
-rw-r--r--crawl-ref/source/itemname.cc24
1 files changed, 20 insertions, 4 deletions
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index 16adb7a234..5de5f16256 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -1637,9 +1637,14 @@ std::string item_def::name_aux(description_level_type desc,
if (food_is_rotten(*this) && !dbname)
buff << "rotting ";
- const std::string _name = get_corpse_name(*this);
+ unsigned long name_type;
+
+ const std::string _name = get_corpse_name(*this, &name_type);
const bool shaped = starts_with(_name, "shaped ");
+ if (!_name.empty() && name_type == MF_NAME_ADJECTIVE)
+ buff << _name << " ";
+
if (!dbname && !starts_with(_name, "the "))
{
buff << mons_type_name(it_plus, DESC_PLAIN) << ' ';
@@ -1655,8 +1660,13 @@ std::string item_def::name_aux(description_level_type desc,
else
buff << "corpse bug";
- if (!_name.empty() && !shaped)
- buff << " of " << _name;
+ if (!_name.empty() && !shaped && name_type != MF_NAME_ADJECTIVE)
+ {
+ if (name_type == MF_NAME_SUFFIX)
+ buff << " " << _name;
+ else
+ buff << " of " << _name;
+ }
break;
}
@@ -3065,12 +3075,18 @@ bool is_named_corpse(const item_def &corpse)
return (corpse.props.exists(CORPSE_NAME_KEY));
}
-std::string get_corpse_name(const item_def &corpse)
+std::string get_corpse_name(const item_def &corpse, unsigned long *name_type)
{
ASSERT(corpse.base_type == OBJ_CORPSES);
if (!corpse.props.exists(CORPSE_NAME_KEY))
return ("");
+ if (name_type != NULL)
+ {
+ *name_type
+ = (unsigned long) corpse.props[CORPSE_NAME_TYPE_KEY].get_long();
+ }
+
return (corpse.props[CORPSE_NAME_KEY].get_string());
}