Fix grass adding/removing ABM.
authorNovatux <nathanael.courant@laposte.net>
Sat, 2 Nov 2013 12:47:45 +0000 (13:47 +0100)
committerNovatux <nathanael.courant@laposte.net>
Sat, 2 Nov 2013 12:47:45 +0000 (13:47 +0100)
mods/default/nodes.lua

index 3c90c99167f21a2c99da193faa4ca1e7e1dfe1bb..b8cdf43393e87c6bd79effacd6d25b0e588b7856 100644 (file)
@@ -137,7 +137,7 @@ minetest.register_abm({
                local above = {x=pos.x, y=pos.y+1, z=pos.z}
                local name = minetest.get_node(above).name
                local nodedef = minetest.registered_nodes[name]
-               if nodedef and nodedef.sunlight_propagates and nodedef.liquidtype == "none" and minetest.get_node_light(above) >= 13 then
+               if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light") and nodedef.liquidtype == "none" and minetest.get_node_light(above) >= 13 then
                        if name == "default:snow" or name == "default:snowblock" then
                                minetest.set_node(pos, {name = "default:dirt_with_snow"})
                        else
@@ -155,7 +155,7 @@ minetest.register_abm({
                local above = {x=pos.x, y=pos.y+1, z=pos.z}
                local name = minetest.get_node(above).name
                local nodedef = minetest.registered_nodes[name]
-               if name ~= "ignore" and nodedef and not (nodedef.sunlight_propagates and nodedef.liquidtype == "none") then
+               if name ~= "ignore" and nodedef and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light") and nodedef.liquidtype == "none") then
                        minetest.set_node(pos, {name = "default:dirt"})
                end
        end