summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dlua.cc
diff options
context:
space:
mode:
authorDarshan Shaligram <dshaligram@users.sourceforge.net>2010-12-24 19:20:59 +0530
committerDarshan Shaligram <dshaligram@users.sourceforge.net>2010-12-24 22:10:37 +0530
commit9e6e6919463bcd6b30c34c430b3ac505c7330915 (patch)
treeb5cf86f90b9d7e22e18c72ee014338aa6d2c22a8 /crawl-ref/source/dlua.cc
parent6a36820c5d0be2b485dcb838e4b1f7ed44e0c734 (diff)
downloadcrawl-ref-9e6e6919463bcd6b30c34c430b3ac505c7330915.tar.gz
crawl-ref-9e6e6919463bcd6b30c34c430b3ac505c7330915.zip
Allow maps to specify different CHANCE and WEIGHT for different depth ranges (Zaba).
Diffstat (limited to 'crawl-ref/source/dlua.cc')
-rw-r--r--crawl-ref/source/dlua.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/crawl-ref/source/dlua.cc b/crawl-ref/source/dlua.cc
index 1ee7ce4028..2df429c3a6 100644
--- a/crawl-ref/source/dlua.cc
+++ b/crawl-ref/source/dlua.cc
@@ -56,6 +56,14 @@ dlua_chunk dlua_chunk::precompiled(const std::string &_chunk)
return (dchunk);
}
+std::string dlua_chunk::describe(const std::string &name) const
+{
+ if (chunk.empty())
+ return "";
+ return make_stringf("function %s()\n%s\nend\n",
+ name.c_str(), chunk.c_str());
+}
+
void dlua_chunk::write(writer& outf) const
{
if (empty())
@@ -163,7 +171,6 @@ int dlua_chunk::load(CLua &interp)
lua_pop(interp, 2);
}
compiled = out.str();
- chunk.clear();
return (err);
}