Skip to content

Commit

Permalink
Flower spread: Only spread to the same surface node
Browse files Browse the repository at this point in the history
  • Loading branch information
paramat committed Feb 17, 2018
1 parent 7754555 commit 495fa32
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mods/flowers/init.lua
Expand Up @@ -154,11 +154,14 @@ function flowers.flower_spread(pos, node)
if num_soils >= 1 then
for si = 1, math.min(3, num_soils) do
local soil = soils[math.random(num_soils)]
local soil_name = minetest.get_node(soil).name
local soil_above = {x = soil.x, y = soil.y + 1, z = soil.z}
light = minetest.get_node_light(soil_above)
if light and light >= 13 and
-- Only spread to same surface node
soil_name == under.name and
-- Desert sand is in the soil group
minetest.get_node(soil).name ~= "default:desert_sand" then
soil_name ~= "default:desert_sand" then
minetest.set_node(soil_above, {name = node.name})
end
end
Expand Down

0 comments on commit 495fa32

Please sign in to comment.