From 8d30f718f7716958598157a13a42b7fce9b5640b Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Tue, 9 Jul 2019 23:51:23 -0600 Subject: [PATCH] math.random can produce up to a maxint, updating requested range --- df_caverns/underworld.lua | 2 +- df_trees/blood_thorn.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/df_caverns/underworld.lua b/df_caverns/underworld.lua index 98fa6ba..706ca12 100644 --- a/df_caverns/underworld.lua +++ b/df_caverns/underworld.lua @@ -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() diff --git a/df_trees/blood_thorn.lua b/df_trees/blood_thorn.lua index 403849c..2564f24 100644 --- a/df_trees/blood_thorn.lua +++ b/df_trees/blood_thorn.lua @@ -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)