mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2025-02-03 05:50:26 +01:00
math.random can produce up to a maxint, updating requested range
This commit is contained in:
parent
bcc1d1d848
commit
8d30f718f7
@ -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()
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user