From 5977a4962f1ca45fd82c5b7ff5911196c7655f00 Mon Sep 17 00:00:00 2001 From: crabman77 Date: Sat, 18 Jun 2016 15:04:52 +0200 Subject: [PATCH] readd fix and comment --- minetestforfun_game/mods/farming/beanpole.lua | 21 +++++++++---------- minetestforfun_game/mods/farming/grapes.lua | 15 +++++++------ 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/minetestforfun_game/mods/farming/beanpole.lua b/minetestforfun_game/mods/farming/beanpole.lua index cef27673..432ffbc3 100755 --- a/minetestforfun_game/mods/farming/beanpole.lua +++ b/minetestforfun_game/mods/farming/beanpole.lua @@ -73,23 +73,22 @@ minetest.register_node("farming:beanpole", { sounds = default.node_sound_leaves_defaults(), on_place = function(itemstack, placer, pointed_thing) - - if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then - return - end - - local nodename = minetest.get_node(pointed_thing.under).name - - if minetest.get_item_group(nodename, "soil") < 2 then - return - end - local top = { x = pointed_thing.above.x, y = pointed_thing.above.y + 1, z = pointed_thing.above.z } + if minetest.is_protected(pointed_thing.above, placer:get_player_name()) + or minetest.is_protected(top, placer:get_player_name()) then -- MFF crabman(18/06/2015) + return + end + local nodename = minetest.get_node(pointed_thing.under).name + + if minetest.get_item_group(nodename, "soil") < 2 then + return + end + nodename = minetest.get_node(top).name if nodename ~= "air" then diff --git a/minetestforfun_game/mods/farming/grapes.lua b/minetestforfun_game/mods/farming/grapes.lua index e2938cc5..c62b0843 100755 --- a/minetestforfun_game/mods/farming/grapes.lua +++ b/minetestforfun_game/mods/farming/grapes.lua @@ -68,8 +68,13 @@ minetest.register_node("farming:trellis", { sounds = default.node_sound_leaves_defaults(), on_place = function(itemstack, placer, pointed_thing) - - if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then + local top = { + x = pointed_thing.above.x, + y = pointed_thing.above.y + 1, + z = pointed_thing.above.z + } + if minetest.is_protected(pointed_thing.above, placer:get_player_name()) + or minetest.is_protected(top, placer:get_player_name()) then -- MFF crabman(18/06/2015) return end @@ -79,12 +84,6 @@ minetest.register_node("farming:trellis", { return end - local top = { - x = pointed_thing.above.x, - y = pointed_thing.above.y + 1, - z = pointed_thing.above.z - } - nodename = minetest.get_node(top).name if nodename ~= "air" then