From 618aa5f167290a4eeffebcaee227ae3453ae8945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez?= Date: Sun, 19 May 2013 04:17:32 -0300 Subject: [PATCH] Placing fences now takes into account protection systems --- signs_lib.lua | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/signs_lib.lua b/signs_lib.lua index e139f0d6..2ebeeadf 100644 --- a/signs_lib.lua +++ b/signs_lib.lua @@ -115,11 +115,20 @@ minetest.register_node(":default:sign_wall", { groups = sign_groups, on_place = function(itemstack, placer, pointed_thing) - local def = minetest.registered_nodes[minetest.env:get_node(pointed_thing.above).name] - if homedecor_node_is_owned(pointed_thing.above, placer) - or (not def.buildable_to) then - return itemstack - end + local name + name = minetest.env:get_node(pointed_thing.under).name + if fences_with_sign[name] then + if homedecor_node_is_owned(pointed_thing.under, placer) then + return itemstack + end + else + name = minetest.env:get_node(pointed_thing.above).name + local def = minetest.registered_nodes[name] + if homedecor_node_is_owned(pointed_thing.above, placer) + or (not def.buildable_to) then + return itemstack + end + end local node=minetest.env:get_node(pointed_thing.under)