Prevent nil as return value of get_node_light()

master
PilzAdam 2012-09-17 18:02:44 +02:00
parent 902f115cd0
commit 883ee3ca7d
1 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,9 @@ function farming:add_plant(full_grown, names, interval, chance)
return
end
pos.y = pos.y+1
if not minetest.env:get_node_light(pos) then
return
end
if minetest.env:get_node_light(pos) < 8 then
return
end
@ -44,6 +47,9 @@ function farming:generate_tree(pos, trunk, leaves, underground, replacements)
end
end
pos.y = pos.y+1
if not minetest.env:get_node_light(pos) then
return
end
if ret or minetest.env:get_node_light(pos) < 8 then
return
end