summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/random.h
diff options
context:
space:
mode:
authorreaverb <reaverb.Crawl@gmail.com>2014-06-10 13:47:28 -0400
committerreaverb <reaverb.Crawl@gmail.com>2014-06-10 13:47:28 -0400
commit2cecdf434401f754e5e8ac3cb8a587116bb51302 (patch)
tree590132bde39d1ad18b295e80cbf2730fc0e22347 /crawl-ref/source/random.h
parent7e81480cda18144ff185f5248639a072b654deff (diff)
downloadcrawl-ref-2cecdf434401f754e5e8ac3cb8a587116bb51302.tar.gz
crawl-ref-2cecdf434401f754e5e8ac3cb8a587116bb51302.zip
Revert "Make random_choose_weighted() end on -1 weight"
This reverts commit 7e81480cda18144ff185f5248639a072b654deff. Turns out I missed some calls to random_choose_weighted(), this change might not even be worth doing.
Diffstat (limited to 'crawl-ref/source/random.h')
-rw-r--r--crawl-ref/source/random.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/crawl-ref/source/random.h b/crawl-ref/source/random.h
index cc9872c8a4..04e8fb4c49 100644
--- a/crawl-ref/source/random.h
+++ b/crawl-ref/source/random.h
@@ -76,8 +76,7 @@ T random_choose_weighted(int weight, T first, ...)
while (nargs-- > 0)
{
const int nweight = va_arg(args, int);
-
- if (nweight == -1)
+ if (!nweight)
break;
const int choice = va_arg(args, int);