math.random can produce up to a maxint, updating requested range

This commit is contained in:
FaceDeer 2019-07-09 23:51:23 -06:00
parent bcc1d1d848
commit 8d30f718f7
2 changed files with 2 additions and 2 deletions

View File

@ -209,7 +209,7 @@ local get_pit = function(pos)
if region_mapblocks < 1 then return nil end
local corner_xz = get_corner(pos)
local next_seed = math.random(1, 1000000000)
local next_seed = math.random(1, 2^31)
math.randomseed(corner_xz.x + corner_xz.z * 2 ^ 8 + mapgen_seed)
local location = scatter_2d(corner_xz, pit_region_size, radius_pit_max + radius_pit_variance)
local variance_multiplier = math.random()

View File

@ -173,7 +173,7 @@ minetest.register_craft({
-- This ensures consistent random maximum to bloodthorn growth
local max_bloodthorn_height = function(pos)
local next_seed = math.random(1, 1000000000)
local next_seed = math.random(1, 2^31)
math.randomseed(pos.x + pos.z * 2 ^ 8)
local output = math.random(3,6)
math.randomseed(next_seed)