mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-06-06 05:44:26 -04:00
Merge b489d9a984
into 0d49978341
This commit is contained in:
commit
f2d15d90ae
1 changed files with 3 additions and 2 deletions
|
@ -5,7 +5,8 @@
|
||||||
-- 'Can grow' function
|
-- 'Can grow' function
|
||||||
|
|
||||||
local random = math.random
|
local random = math.random
|
||||||
|
local min_light_level = tonumber(minetest.setting_get("trees_min_light_level")) or 13
|
||||||
|
|
||||||
local function can_grow(pos)
|
local function can_grow(pos)
|
||||||
local node_under = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z})
|
local node_under = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z})
|
||||||
if not node_under then
|
if not node_under then
|
||||||
|
@ -17,7 +18,7 @@ local function can_grow(pos)
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
local light_level = minetest.get_node_light(pos)
|
local light_level = minetest.get_node_light(pos)
|
||||||
if not light_level or light_level < 13 then
|
if not light_level or light_level < min_light_level then
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Add table
Reference in a new issue