summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dat/clua/util.lua
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-03 15:27:19 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-03 15:27:19 +0000
commit275cb245c18f2931370c6bbee4e7b4e6166dd052 (patch)
tree3a8d4faba1b5b5537cc2ae324d6c759dfc1d5de6 /crawl-ref/source/dat/clua/util.lua
parent9a7fc9ef17d846b946c934af5f7fa84c94c8f860 (diff)
downloadcrawl-ref-275cb245c18f2931370c6bbee4e7b4e6166dd052.tar.gz
crawl-ref-275cb245c18f2931370c6bbee4e7b4e6166dd052.zip
Expand portal entity prop in disappearance messages.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7732 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/dat/clua/util.lua')
-rw-r--r--crawl-ref/source/dat/clua/util.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/crawl-ref/source/dat/clua/util.lua b/crawl-ref/source/dat/clua/util.lua
index 9e4fcc6f34..fab5720a7a 100644
--- a/crawl-ref/source/dat/clua/util.lua
+++ b/crawl-ref/source/dat/clua/util.lua
@@ -214,6 +214,10 @@ function util.random_weighted_from(weightfn, list)
end
function util.expand_entity(entity, msg)
+ if not entity or not msg then
+ return msg
+ end
+
local msg_a = string.gsub(msg, "$F%{(%w+)%}",
function (desc)
return crawl.grammar(entity, desc)