summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dat/clua/util.lua
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-27 07:37:49 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2009-03-27 07:37:49 +0000
commitf35c0d8ae40ea8120a04e05a7ac5a8b4d8fa5c6e (patch)
treecdd8ffd011e513d70151e97e8d1b5fb369b6b5e1 /crawl-ref/source/dat/clua/util.lua
parent3883849859c52b63dfb3cba8f7fc8ec41aa65169 (diff)
downloadcrawl-ref-f35c0d8ae40ea8120a04e05a7ac5a8b4d8fa5c6e.tar.gz
crawl-ref-f35c0d8ae40ea8120a04e05a7ac5a8b4d8fa5c6e.zip
Make it easier for ziggurat monster specs to weight monsters by ziggurat
depth. Fix ziggurat spec weights being ignored. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9559 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/dat/clua/util.lua')
-rw-r--r--crawl-ref/source/dat/clua/util.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/crawl-ref/source/dat/clua/util.lua b/crawl-ref/source/dat/clua/util.lua
index 0a606d6237..fa78b189aa 100644
--- a/crawl-ref/source/dat/clua/util.lua
+++ b/crawl-ref/source/dat/clua/util.lua
@@ -196,8 +196,9 @@ end
function util.random_weighted_from(weightfn, list)
if type(weightfn) ~= "function" then
+ local weightkey = weightfn
weightfn = function (table)
- return table[weightfn]
+ return table[weightkey]
end
end
local cweight = 0