Skip to content

Commit 495fa32

Browse files
committed
Flower spread: Only spread to the same surface node
1 parent 7754555 commit 495fa32

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mods/flowers/init.lua

+4-1
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,14 @@ function flowers.flower_spread(pos, node)
154154
if num_soils >= 1 then
155155
for si = 1, math.min(3, num_soils) do
156156
local soil = soils[math.random(num_soils)]
157+
local soil_name = minetest.get_node(soil).name
157158
local soil_above = {x = soil.x, y = soil.y + 1, z = soil.z}
158159
light = minetest.get_node_light(soil_above)
159160
if light and light >= 13 and
161+
-- Only spread to same surface node
162+
soil_name == under.name and
160163
-- Desert sand is in the soil group
161-
minetest.get_node(soil).name ~= "default:desert_sand" then
164+
soil_name ~= "default:desert_sand" then
162165
minetest.set_node(soil_above, {name = node.name})
163166
end
164167
end

0 commit comments

Comments
 (0)