summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_dgnlvl.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2012-07-08 00:00:27 -0400
committerNeil Moore <neil@s-z.org>2012-07-08 00:00:27 -0400
commite06d317e392c3221b852c21e17b172bf78ec0315 (patch)
tree38d97b8dcaf71fb3035e4bb5264fac0cb9c5744e /crawl-ref/source/l_dgnlvl.cc
parent66aaafa61a87e792db846701478545d1312a046d (diff)
downloadcrawl-ref-e06d317e392c3221b852c21e17b172bf78ec0315.tar.gz
crawl-ref-e06d317e392c3221b852c21e17b172bf78ec0315.zip
dlua function to get the depth (length) of a branch.
Call as: dgn.br_depth("Elf"), or dgn.br_depth(dgn.level_name(dgn.level_id())) for the current branch.
Diffstat (limited to 'crawl-ref/source/l_dgnlvl.cc')
-rw-r--r--crawl-ref/source/l_dgnlvl.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/crawl-ref/source/l_dgnlvl.cc b/crawl-ref/source/l_dgnlvl.cc
index 79041af5fe..05ac2db2d2 100644
--- a/crawl-ref/source/l_dgnlvl.cc
+++ b/crawl-ref/source/l_dgnlvl.cc
@@ -31,6 +31,7 @@ BRANCHFN(parent_branch, string,
br.parent_branch == NUM_BRANCHES
? ""
: branches[br.parent_branch].abbrevname)
+BRANCHFN(depth, number, brdepth[br.id]);
static void _push_level_id(lua_State *ls, const level_id &lid)
{
@@ -88,6 +89,7 @@ const struct luaL_reg dgn_level_dlib[] =
{ "br_rockcol", dgn_br_rockcol },
{ "br_has_uniques", dgn_br_has_uniques },
{ "br_parent_branch", dgn_br_parent_branch },
+{ "br_depth", dgn_br_depth },
{ "level_id", dgn_level_id },
{ "level_name", dgn_level_name },