mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2025-03-11 06:07:44 +01:00
fix bad use of random APIs in mcl_bamboo
This commit is contained in:
parent
df08ba7e82
commit
f128556ba7
1 changed files with 1 additions and 3 deletions
|
@ -7,7 +7,6 @@
|
|||
local DEBUG = false
|
||||
|
||||
local rand = math.random
|
||||
math.randomseed((os.time() + 31) * 31415) -- try to make a valid seed
|
||||
local BAMBOO_MAX_HEIGHT = 16 -- base height check.
|
||||
|
||||
local BAMBOO_SOIL_DIST = BAMBOO_MAX_HEIGHT * -1
|
||||
|
@ -145,8 +144,7 @@ function mcl_bamboo.grow_bamboo(pos, bonemeal_applied)
|
|||
-- If applying bonemeal, randomly grow two segments instead of one
|
||||
local grow_amount = 1
|
||||
if bonemeal_applied then
|
||||
local rng = PcgRandom(minetest.hash_node_position(pos) + minetest.get_us_time())
|
||||
if rng:next(1, GROW_DOUBLE_CHANCE) == 1 then
|
||||
if rand(1, GROW_DOUBLE_CHANCE) == 1 then
|
||||
grow_amount = 2
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue