From 88825e6e16ab87cc9f248ee298d8a8421c5ffb55 Mon Sep 17 00:00:00 2001
From: Brandon <brandon@bremaweb.com>
Date: Wed, 28 Sep 2016 07:40:14 -0500
Subject: Fix sign text being removed

---
 default.lua | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

(limited to 'default.lua')

diff --git a/default.lua b/default.lua
index ab1d243..7a4e522 100644
--- a/default.lua
+++ b/default.lua
@@ -1,18 +1,18 @@
 if minetest.get_modpath("default") then	
 	minetest.override_item("default:sign_wall", {
 		on_receive_fields = function(pos, formname, fields, sender)
-			local name = sender:get_player_name()
-			if landrush.can_interact(pos, name) then
-				local meta = minetest.get_meta(pos)
-				fields.text = fields.text or ""
-				print((name or "").." wrote \""..fields.text..
-					"\" to sign at "..minetest.pos_to_string(pos))
-				meta:set_string("text", fields.text)
-				meta:set_string("infotext", '"'..fields.text..'"')
-			else
-				local owner = landrush.get_owner(pos)
-				minetest.chat_send_player(name, "Area owned by "..owner)
+			--print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields))
+			if not fields.text then return end
+			local player_name = sender:get_player_name()
+			if minetest.is_protected(pos, player_name) then
+				minetest.record_protection_violation(pos, player_name)
+				return
 			end
+			local meta = minetest.get_meta(pos)
+			minetest.log("action", (player_name or "") .. " wrote \"" ..
+				fields.text .. "\" to sign at " .. minetest.pos_to_string(pos))
+			meta:set_string("text", fields.text)
+			meta:set_string("infotext", '"' .. fields.text .. '"')
 		end,
 	})
 end
-- 
cgit v1.2.3