summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
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
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')
-rw-r--r--crawl-ref/source/dat/clua/lm_timed.lua2
-rw-r--r--crawl-ref/source/dat/clua/util.lua4
2 files changed, 5 insertions, 1 deletions
diff --git a/crawl-ref/source/dat/clua/lm_timed.lua b/crawl-ref/source/dat/clua/lm_timed.lua
index c12ec8157f..37be6998d9 100644
--- a/crawl-ref/source/dat/clua/lm_timed.lua
+++ b/crawl-ref/source/dat/clua/lm_timed.lua
@@ -57,7 +57,7 @@ function TimedMarker:timeout(marker, verbose, affect_player)
if verbose then
if you.see_grid(marker:pos()) then
- crawl.mpr( self.props.disappear or
+ crawl.mpr( util.expand_entity(self.props.entity, self.props.disappear) or
dgn.feature_desc_at(x, y, "The") .. " disappears!")
else
crawl.mpr("The walls and floor vibrate strangely for a moment.")
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)