Chorus plant: Prevent double placement of flowers

This commit is contained in:
Wuzzy 2019-03-09 23:19:14 +01:00
parent 05e8cc8a2c
commit 655a240107

View file

@ -283,14 +283,20 @@ mcl_end.grow_chorus_plant_step = function(pos, node)
for _, f in ipairs(new_flowers) do for _, f in ipairs(new_flowers) do
if age >= MAX_FLOWER_AGE then if age >= MAX_FLOWER_AGE then
local nn = minetest.get_node(f).name
if nn ~= "mcl_end:chorus_flower" and nn ~= "mcl_end:chorus_flower_dead" then
minetest.set_node(f, {name="mcl_end:chorus_flower_dead"}) minetest.set_node(f, {name="mcl_end:chorus_flower_dead"})
grown = true grown = true
end
else else
local nn = minetest.get_node(f).name
if nn ~= "mcl_end:chorus_flower" and nn ~= "mcl_end:chorus_flower_dead" then
minetest.set_node(f, {name="mcl_end:chorus_flower", param2 = age}) minetest.set_node(f, {name="mcl_end:chorus_flower", param2 = age})
table.insert(new_flower_buds, f) table.insert(new_flower_buds, f)
grown = true grown = true
end end
end end
end
if #new_flowers >= 1 then if #new_flowers >= 1 then
minetest.set_node(pos, {name="mcl_end:chorus_plant"}) minetest.set_node(pos, {name="mcl_end:chorus_plant"})
grown = true grown = true