summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-util.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-28 15:39:43 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-28 15:39:43 +0000
commit918d9df900b861c8b34b7bb4be9f7d53538e7b47 (patch)
tree0fbcec42655ff488f03db5671972327c660898c2 /crawl-ref/source/mon-util.cc
parent03049032deecd419f83bb23f2c9abd6ba1654c81 (diff)
downloadcrawl-ref-918d9df900b861c8b34b7bb4be9f7d53538e7b47.tar.gz
crawl-ref-918d9df900b861c8b34b7bb4be9f7d53538e7b47.zip
Fix some more bugs with imp taunts.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9279 c06c8d41-db1a-0410-9941-cceddc491573
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"));