diff options
author | Neil Moore <neil@s-z.org> | 2012-07-08 00:00:27 -0400 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2012-07-08 00:00:27 -0400 |
commit | e06d317e392c3221b852c21e17b172bf78ec0315 (patch) | |
tree | 38d97b8dcaf71fb3035e4bb5264fac0cb9c5744e /crawl-ref/source/l_dgnlvl.cc | |
parent | 66aaafa61a87e792db846701478545d1312a046d (diff) | |
download | crawl-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.cc | 2 |
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 }, |