summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/clua.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/clua.cc')
-rw-r--r--crawl-ref/source/clua.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc
index 7107dc6355..8ada60d847 100644
--- a/crawl-ref/source/clua.cc
+++ b/crawl-ref/source/clua.cc
@@ -2010,7 +2010,7 @@ static int crawl_random_element(lua_State *ls)
if (rollsize > 0)
{
rollsize += this_weight;
- if (random2(rollsize) < this_weight)
+ if (x_chance_in_y(this_weight, rollsize))
{
lua_pushvalue(ls, key_idx);
lua_replace(ls, value_idx);