summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-speak.cc
diff options
context:
space:
mode:
authorJude Brown <bookofjude@users.sourceforge.net>2011-03-19 10:01:13 +1000
committerJude Brown <bookofjude@users.sourceforge.net>2011-03-19 10:01:13 +1000
commit9a952ef81f23c62fadf3653de082126507b4444c (patch)
treefbe38323d93cdf1bccc29ba00d4ce9950e0ca726 /crawl-ref/source/mon-speak.cc
parentc04c84ed55f490a527ac4ecb7d5cf1e6c683d206 (diff)
downloadcrawl-ref-9a952ef81f23c62fadf3653de082126507b4444c.tar.gz
crawl-ref-9a952ef81f23c62fadf3653de082126507b4444c.zip
Maybe resolve #3411: speech in portal vaults from branches.
This tries again to fetch a speech string from the database if the first attempt fails -- this time using no prefixes instead of the provided list of prefixes. I can't think of any situations where a monster defines a speech-key property (or function) and would ever require the relevant prefixes. There's no reason not to try them to start with, however.
Diffstat (limited to 'crawl-ref/source/mon-speak.cc')
-rw-r--r--crawl-ref/source/mon-speak.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/crawl-ref/source/mon-speak.cc b/crawl-ref/source/mon-speak.cc
index 21875575f3..101f0205c0 100644
--- a/crawl-ref/source/mon-speak.cc
+++ b/crawl-ref/source/mon-speak.cc
@@ -622,6 +622,18 @@ bool mons_speaks(monster* mons)
mons->props["speech_key"].get_string(),
mons, no_player, no_foe, no_foe_name,
no_god, unseen);
+
+ if (msg.empty())
+ {
+ // Try again without the prefixes if the key is empty. Vaults
+ // *really* want monsters to use the key specified, rather than
+ // the key with prefixes.
+ std::vector<std::string> faux_prefixes;
+ msg = _get_speak_string(faux_prefixes,
+ mons->props["speech_key"].get_string(),
+ mons, no_player, no_foe, no_foe_name,
+ no_god, unseen);
+ }
}
// If the monster was originally a unique which has been polymorphed