summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/l_travel.cc
diff options
context:
space:
mode:
authorelliptic <hyperelliptical@gmail.com>2014-03-28 12:16:13 -0400
committerelliptic <hyperelliptical@gmail.com>2014-03-28 12:16:13 -0400
commit3cecf4cad8f0273cdad8476e4f3a1bd888555f2d (patch)
treed23b7f5401e4d232a40f4c2860d6e81dcbcdc36c /crawl-ref/source/l_travel.cc
parentaaf79ab05752396355c40f35892e3abf7b50629b (diff)
downloadcrawl-ref-3cecf4cad8f0273cdad8476e4f3a1bd888555f2d.tar.gz
crawl-ref-3cecf4cad8f0273cdad8476e4f3a1bd888555f2d.zip
Improve view.find_deepest_explored().
It now returns 0 rather than 1 if the player hasn't seen the branch yet.
Diffstat (limited to 'crawl-ref/source/l_travel.cc')
-rw-r--r--crawl-ref/source/l_travel.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/crawl-ref/source/l_travel.cc b/crawl-ref/source/l_travel.cc
index 69dc159d11..be2a04f114 100644
--- a/crawl-ref/source/l_travel.cc
+++ b/crawl-ref/source/l_travel.cc
@@ -56,6 +56,8 @@ LUAFN(l_find_deepest_explored)
const level_id lid(str_to_branch(branch), 1);
if (lid.branch == NUM_BRANCHES)
luaL_error(ls, "Bad branch name: '%s'", branch.c_str());
+ if (!is_known_branch_id(lid.branch))
+ PLUARET(number, 0);
PLUARET(number, find_deepest_explored(lid).depth);
}