forked from mtcontrib/farming
Fixed growing underground bug
This commit is contained in:
parent
899375e3c7
commit
024552dbe9
3
init.lua
3
init.lua
@ -334,11 +334,12 @@ function farming.plant_growth_timer(pos, elapsed, node_name)
|
|||||||
|
|
||||||
local growth
|
local growth
|
||||||
|
|
||||||
local light_pos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
local light_pos = { x = pos.x, y = pos.y, z = pos.z }
|
||||||
local lambda = elapsed / STAGE_LENGTH_AVG
|
local lambda = elapsed / STAGE_LENGTH_AVG
|
||||||
if lambda < 0.1 then return true end
|
if lambda < 0.1 then return true end
|
||||||
if max_growth == 1 or lambda < 2.0 then
|
if max_growth == 1 or lambda < 2.0 then
|
||||||
local light = (minetest.get_node_light(light_pos) or 0) -- CHANGED
|
local light = (minetest.get_node_light(light_pos) or 0) -- CHANGED
|
||||||
|
print ("light level:", light)
|
||||||
if not in_range(light, MIN_LIGHT, MAX_LIGHT) then return true end
|
if not in_range(light, MIN_LIGHT, MAX_LIGHT) then return true end
|
||||||
growth = 1
|
growth = 1
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user