summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/mon-util.cc')
-rw-r--r--crawl-ref/source/mon-util.cc24
1 files changed, 16 insertions, 8 deletions
diff --git a/crawl-ref/source/mon-util.cc b/crawl-ref/source/mon-util.cc
index d93b533b71..c7ee7c10eb 100644
--- a/crawl-ref/source/mon-util.cc
+++ b/crawl-ref/source/mon-util.cc
@@ -8268,18 +8268,26 @@ static std::string _replace_god_name(god_type god, bool need_verb = false,
static std::string _get_species_insult(const std::string &species,
const std::string &type)
{
- std::string lookup = "insult ";
+ std::string insult;
+ std::string lookup;
+
// Get species genus.
- lookup += species_name(you.species, 1, true);
- lookup += " ";
- lookup += type;
+ if (!species.empty())
+ {
+ lookup = "insult ";
+ lookup += species;
+ lookup += " ";
+ lookup += type;
+
+ insult = getSpeakString(lowercase(lookup));
+ }
- std::string insult = getSpeakString(lowercase(lookup));
if (insult.empty()) // Species too specific?
{
- lookup = "insult general ";
+ lookup = "insult general ";
lookup += type;
- insult = getSpeakString(lookup);
+
+ insult = getSpeakString(lookup);
}
return (insult);
@@ -8559,7 +8567,7 @@ std::string do_mon_str_replacements(const std::string &in_msg,
}
// Replace with species specific insults.
- if (foe != NULL && msg.find("@species_insult_") != std::string::npos)
+ if (msg.find("@species_insult_") != std::string::npos)
{
msg = replace_all(msg, "@species_insult_adj1@",
_get_species_insult(foe_species, "adj1"));