summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-pick.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-03-23 10:59:02 +0100
committerAdam Borowski <kilobyte@angband.pl>2013-03-23 10:59:02 +0100
commit7c173f3e3518743e7abdb1f9b95cca87e4623515 (patch)
tree87004936699ed220f7ee9982eec43b4be2507950 /crawl-ref/source/mon-pick.cc
parentcf485f00f63a0b771bbb04f38ad803972647a5e8 (diff)
downloadcrawl-ref-7c173f3e3518743e7abdb1f9b95cca87e4623515.tar.gz
crawl-ref-7c173f3e3518743e7abdb1f9b95cca87e4623515.zip
Be forgiving for single-level SEMI ranges.
Diffstat (limited to 'crawl-ref/source/mon-pick.cc')
-rw-r--r--crawl-ref/source/mon-pick.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/crawl-ref/source/mon-pick.cc b/crawl-ref/source/mon-pick.cc
index a1c918e9e0..c681395d81 100644
--- a/crawl-ref/source/mon-pick.cc
+++ b/crawl-ref/source/mon-pick.cc
@@ -124,8 +124,10 @@ static int _rarity_at(const pop_entry *pop, int depth)
return rar;
case SEMI: // 100% in the middle, 50% at the edges
- ASSERT(len > 0);
- len *= 2;
+ if (len)
+ len *= 2;
+ else
+ len += 2; // a single-level range
return rar * (len - abs(pop->minr + pop->maxr - 2 * depth))
/ len;