mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-01-08 09:37:32 +01:00
fix undefined globals in mcl_bamboo (#4797)
Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4797 Reviewed-by: teknomunk <teknomunk@protonmail.com> Co-authored-by: kno10 <erich.schubert@gmail.com> Co-committed-by: kno10 <erich.schubert@gmail.com>
This commit is contained in:
parent
8a08f0dbcd
commit
e5822ecc35
@ -111,8 +111,7 @@ function mcl_bamboo.grow_bamboo(pos, bonemeal_applied)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Determine the location of soil
|
-- Determine the location of soil
|
||||||
local soil_pos
|
local soil_pos = mcl_util.trace_nodes(pos, -1, mcl_bamboo.bamboo_set, BAMBOO_MAX_HEIGHT - 1)
|
||||||
soil_pos,a,b = mcl_util.trace_nodes(pos, -1, mcl_bamboo.bamboo_set, BAMBOO_MAX_HEIGHT - 1)
|
|
||||||
|
|
||||||
-- No soil found, return false so that bonemeal isn't used
|
-- No soil found, return false so that bonemeal isn't used
|
||||||
if not soil_pos then return false end
|
if not soil_pos then return false end
|
||||||
@ -147,7 +146,7 @@ function mcl_bamboo.grow_bamboo(pos, bonemeal_applied)
|
|||||||
local grow_amount = 1
|
local grow_amount = 1
|
||||||
if bonemeal_applied then
|
if bonemeal_applied then
|
||||||
local rng = PcgRandom(minetest.hash_node_position(pos) + minetest.get_us_time())
|
local rng = PcgRandom(minetest.hash_node_position(pos) + minetest.get_us_time())
|
||||||
if rng:next(1, GROW_DOUBLE_CHANGE) == 1 then
|
if rng:next(1, GROW_DOUBLE_CHANCE) == 1 then
|
||||||
grow_amount = 2
|
grow_amount = 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user