summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/abyss.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2013-11-25 09:16:44 -0500
committerNeil Moore <neil@s-z.org>2013-11-25 09:37:22 -0500
commit7e585a6e74b9a1455f168e7e88265e446448c1c7 (patch)
tree702907b2a8e69b5e6e51ee9aebc21409bdf0c44b /crawl-ref/source/abyss.cc
parent1ee9a7d778c78a71454ca1e487d51dfbbba3274c (diff)
downloadcrawl-ref-7e585a6e74b9a1455f168e7e88265e446448c1c7.tar.gz
crawl-ref-7e585a6e74b9a1455f168e7e88265e446448c1c7.zip
Correct abyssal guest level picking formula.
The old formula chose Branch:0 starting on Abyss:3 (or earlier for shallow branches), and divided by zero immediately on entering Abyss:5. Make the formula match the comment: linearly interpolate between Branch:⌈brlen/2⌉ at Abyss:1 and Branch:brlen at Abyss:5.
Diffstat (limited to 'crawl-ref/source/abyss.cc')
-rw-r--r--crawl-ref/source/abyss.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/abyss.cc b/crawl-ref/source/abyss.cc
index d81dec3f6d..9d18b22365 100644
--- a/crawl-ref/source/abyss.cc
+++ b/crawl-ref/source/abyss.cc
@@ -1390,7 +1390,7 @@ static level_id _pick_guest_level()
const int brd = max(brdepth[br], 1);
// On Abyss:1, pick from half of the branch, on Abyss:5 from branch:$.
- return level_id(br, brd - brd * 4 / (5 - d) / 2);
+ return level_id(br, (brd * (4 + d - 1)/4 + 1) / 2);
}
static void _initialize_abyss_state()