Flora spread: Do not replace flora with dry shrub, only 'return'
authorparamat <mat.gregory@virginmedia.com>
Wed, 22 Mar 2017 17:51:29 +0000 (17:51 +0000)
committerparamat <mat.gregory@virginmedia.com>
Wed, 22 Mar 2017 22:30:35 +0000 (22:30 +0000)
If there is no group:soil node found below, do not replace flora with
dry shrub, this was breaking flower pots and other mods.
Originally, flora would only turn to dry shrub if in desert sand.

mods/flowers/init.lua

index c71bc29c6488a2544b50fe9cdc094297feb67b79..f5955d8c99ffca89a7b82caeb646a3f6a3ce3c97 100644 (file)
@@ -107,10 +107,9 @@ function flowers.flower_spread(pos, node)
        pos.y = pos.y - 1
        local under = minetest.get_node(pos)
        pos.y = pos.y + 1
-       if minetest.get_item_group(under.name, "soil") == 0 and
-                       -- Do not replace sand dune grasses
-                       under.name ~= "default:sand" then
-               minetest.set_node(pos, {name = "default:dry_shrub"})
+       if minetest.get_item_group(under.name, "soil") == 0 then
+               -- Do not replace with dry shrub here as
+               -- this breaks flower pots and other mods.
                return
        end