Before, it generated a random number between min and max, inclusive. Now, the highest number returned is max-1
Something like
Code: Select all
local dist={}
local temp
for i=0,999999 do
temp=dsb_rand(0,3)
if (dist[temp] == nil) then
dist[temp] = 1
else
dist[temp] = dist[temp]+1
end
end
for k,v in pairs(dist) do
__log(tostring(k) .. " -> " .. tostring(v))
end
Note that this is not necessarily wrong, per-se, but it is a change from existing behaviour. (And may cause errors all through the base lua if that's expecting the old behaviour)