diff options
author | infiniplex <infiniplex@hotmail.com> | 2014-02-14 21:45:17 -0600 |
---|---|---|
committer | Steve Melenchuk <smelenchuk@gmail.com> | 2014-05-12 17:29:13 -0600 |
commit | 925dd76bdfdde4af1bab090af20090e9445d105b (patch) | |
tree | b1d4a4c851e388a8a1d05f7c4ebe4b63c1c4e011 /crawl-ref/source/l_you.cc | |
parent | 10da0d218ef564593319c90d9287e560f4fcafba (diff) | |
download | crawl-ref-925dd76bdfdde4af1bab090af20090e9445d105b.tar.gz crawl-ref-925dd76bdfdde4af1bab090af20090e9445d105b.zip |
Changed you.depth_fraction to return in full range [0, 1]
Diffstat (limited to 'crawl-ref/source/l_you.cc')
-rw-r--r-- | crawl-ref/source/l_you.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crawl-ref/source/l_you.cc b/crawl-ref/source/l_you.cc index cfd1367607..bc94c22573 100644 --- a/crawl-ref/source/l_you.cc +++ b/crawl-ref/source/l_you.cc @@ -166,7 +166,8 @@ LUARET1(you_where, string, level_id::current().describe().c_str()) LUARET1(you_branch, string, level_id::current().describe(false, false).c_str()) LUARET1(you_depth, number, you.depth) LUARET1(you_depth_fraction, number, - (float)you.depth / brdepth[you.where_are_you]) + (brdepth[you.where_are_you] <= 1) ? 1 + : ((float)(you.depth - 1) / (brdepth[you.where_are_you] - 1))) // [ds] Absolute depth is 1-based for Lua to match things like DEPTH: // which are also 1-based. Yes, this is confusing. FIXME: eventually // change you.absdepth0 to be 1-based as well. |