Add support for walkable plants
authorhdastwb <hdastwb@hdastwb.heliohost.org>
Thu, 27 Jun 2013 18:08:51 +0000 (14:08 -0400)
committerPilzAdam <pilzadam@minetest.net>
Thu, 11 Jul 2013 00:44:37 +0000 (02:44 +0200)
mods/farming/init.lua

index 3c378015658afcfd957f37030b0469f5d35d4ab0..9508596e550be3f86e4584727b280b8773e5f507 100644 (file)
@@ -30,7 +30,10 @@ minetest.register_abm({
                pos.y = pos.y+1
                local nn = minetest.get_node(pos).name
                pos.y = pos.y-1
-               if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].walkable then
+               if minetest.registered_nodes[nn] and
+                               minetest.registered_nodes[nn].walkable and
+                               minetest.get_item_group(nn, "plant") == 0
+               then
                        minetest.set_node(pos, {name="default:dirt"})
                end
                -- check if there is water nearby