summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/random-var.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2011-09-19 12:30:48 +0200
committerAdam Borowski <kilobyte@angband.pl>2011-09-19 12:30:48 +0200
commita51d98d6c6065e0a5ac6655ea1cfe28c5ef8eb87 (patch)
tree969511d7758f3070a7ea74c6fc363b116b53e6a1 /crawl-ref/source/random-var.cc
parent0146b630395f24052304cb98a33367d78245202b (diff)
downloadcrawl-ref-a51d98d6c6065e0a5ac6655ea1cfe28c5ef8eb87.tar.gz
crawl-ref-a51d98d6c6065e0a5ac6655ea1cfe28c5ef8eb87.zip
Fix random_var division by a number other than 2.
Diffstat (limited to 'crawl-ref/source/random-var.cc')
-rw-r--r--crawl-ref/source/random-var.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/random-var.cc b/crawl-ref/source/random-var.cc
index 794e3c152b..ebfe54deba 100644
--- a/crawl-ref/source/random-var.cc
+++ b/crawl-ref/source/random-var.cc
@@ -150,7 +150,7 @@ random_var operator/(const random_var& x, int d)
std::vector<int> weights(end - start, 0);
for (int v = x.min(); v <= x.max(); ++v)
- weights[v/2 - start] += x.weight(v);
+ weights[v / d - start] += x.weight(v);
return (random_var(start, end, weights));
}