summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dlua.cc
diff options
context:
space:
mode:
authorDarshan Shaligram <dshaligram@users.sourceforge.net>2010-06-22 02:31:18 +0530
committerDarshan Shaligram <dshaligram@users.sourceforge.net>2010-06-22 18:06:51 +0530
commit3e4f4ef9e85c9d41a359ad9f0badfccd108838d3 (patch)
tree7831ea828199b4cd603e57a05121b7321fa713ed /crawl-ref/source/dlua.cc
parent154e321cbb49f50b90cbd63fafd01f58f13e4f03 (diff)
downloadcrawl-ref-3e4f4ef9e85c9d41a359ad9f0badfccd108838d3.tar.gz
crawl-ref-3e4f4ef9e85c9d41a359ad9f0badfccd108838d3.zip
Allow corpses to be placed in .des files.
Add item property CORPSE_NO_DECAY to disallow decay on corpses/skeletons/chunks. Wizmode &% now creates an item using the .des file item name parser; &o remains the old wizmode item-gen command. Corpse decay for corpses placed by maps can be controlled using dgn.delayed_decay.
Diffstat (limited to 'crawl-ref/source/dlua.cc')
-rw-r--r--crawl-ref/source/dlua.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/crawl-ref/source/dlua.cc b/crawl-ref/source/dlua.cc
index 5d75502cd6..5b7f271eb1 100644
--- a/crawl-ref/source/dlua.cc
+++ b/crawl-ref/source/dlua.cc
@@ -264,6 +264,12 @@ std::string dlua_chunk::get_chunk_prefix(const std::string &sorig) const
return rewrite_chunk_prefix(sorig, true);
}
+static void _dlua_register_constants(CLua &lua)
+{
+ lua_pushstring(lua, CORPSE_NEVER_DECAYS);
+ lua.setglobal("CORPSE_NEVER_DECAYS");
+}
+
void init_dungeon_lua()
{
lua_stack_cleaner clean(dlua);
@@ -294,4 +300,6 @@ void init_dungeon_lua()
register_itemlist(dlua);
register_monslist(dlua);
+
+ _dlua_register_constants(dlua);
}